@dssp/supervision 1.0.0-alpha.7 → 1.0.0-alpha.74
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/graphql/building-inspection.d.ts +1 -0
- package/dist-client/graphql/building-inspection.js +101 -0
- package/dist-client/graphql/building-inspection.js.map +1 -0
- package/dist-client/pages/action-plan/action-plan-list-page.d.ts +1 -2
- package/dist-client/pages/action-plan/action-plan-list-page.js +1 -2
- package/dist-client/pages/action-plan/action-plan-list-page.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.d.ts +22 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.js +171 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-defect.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.d.ts +59 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js +868 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-ai-measurement.js.map +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.d.ts +8 -6
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js +116 -65
- package/dist-client/pages/building-inspection/building-inspection-detail-camera.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.d.ts +11 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-checklist.js +147 -72
- 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 +1 -0
- package/dist-client/pages/building-inspection/building-inspection-detail-drawing.js +78 -14
- 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 +26 -2
- package/dist-client/pages/building-inspection/building-inspection-list.js +375 -34
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/building-inspection/building-inspection-management.d.ts +72 -0
- package/dist-client/pages/building-inspection/building-inspection-management.js +1256 -0
- package/dist-client/pages/building-inspection/building-inspection-management.js.map +1 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.d.ts +3 -0
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js +112 -20
- package/dist-client/pages/building-inspection/component/building-inspection-detail-header.js.map +1 -1
- package/dist-client/pages/building-inspection/component/daily-worklog-popup.d.ts +27 -0
- package/dist-client/pages/building-inspection/component/daily-worklog-popup.js +542 -0
- package/dist-client/pages/building-inspection/component/daily-worklog-popup.js.map +1 -0
- package/dist-client/pages/building-inspection/component/image-preview-popup.d.ts +15 -0
- package/dist-client/pages/building-inspection/component/image-preview-popup.js +348 -0
- package/dist-client/pages/building-inspection/component/image-preview-popup.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.d.ts +25 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js +491 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-request-document.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.d.ts +31 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js +485 -0
- package/dist-client/pages/building-inspection/component/inspection-document/inspection-result-notification.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.d.ts +27 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js +416 -0
- package/dist-client/pages/building-inspection/component/inspection-document/photo-album-popup.js.map +1 -0
- package/dist-client/pages/building-inspection/component/inspection-event-provider.d.ts +2 -1
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js +42 -18
- package/dist-client/pages/building-inspection/component/inspection-event-provider.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-create-popup.js +17 -5
- package/dist-client/pages/building-inspection/inspection-create-popup.js.map +1 -1
- package/dist-client/pages/building-inspection/inspection-with-checklist-create-popup.d.ts +3 -0
- package/dist-client/pages/building-inspection/inspection-with-checklist-create-popup.js +791 -0
- package/dist-client/pages/building-inspection/inspection-with-checklist-create-popup.js.map +1 -0
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.d.ts +16 -2
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js +249 -45
- package/dist-client/pages/building-inspection-grid/building-inspection-grid-detail.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js +9 -3
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-create-popup.js.map +1 -1
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.d.ts +19 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js +205 -0
- package/dist-client/pages/building-inspection-grid/component/grid-inspection-list-layer.js.map +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.d.ts +1 -0
- package/dist-client/pages/checklist/attachment-list-popup.js +251 -69
- package/dist-client/pages/checklist/attachment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.d.ts +5 -0
- package/dist-client/pages/checklist/checklist-view.js +191 -30
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/pages/checklist/comment-list-popup.js +15 -5
- package/dist-client/pages/checklist/comment-list-popup.js.map +1 -1
- package/dist-client/pages/checklist/file-preview-popup.js +0 -1
- package/dist-client/pages/checklist/file-preview-popup.js.map +1 -1
- package/dist-client/pages/checklist/inspection-info-popup.d.ts +49 -0
- package/dist-client/pages/checklist/inspection-info-popup.js +683 -0
- package/dist-client/pages/checklist/inspection-info-popup.js.map +1 -0
- package/dist-client/pages/checklist/inspection-tab-popup.d.ts +18 -0
- package/dist-client/pages/checklist/inspection-tab-popup.js +196 -0
- package/dist-client/pages/checklist/inspection-tab-popup.js.map +1 -0
- package/dist-client/pages/checklist-database/checklist-database.d.ts +35 -0
- package/dist-client/pages/checklist-database/checklist-database.js +539 -0
- package/dist-client/pages/checklist-database/checklist-database.js.map +1 -0
- package/dist-client/pages/checklist-template/checklist-template-item.js +39 -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/construction-checklist-template-item-popup.d.ts +2 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-item-popup.js +242 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-item-popup.js.map +1 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-list.d.ts +55 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-list.js +409 -0
- package/dist-client/pages/checklist-template/construction-checklist-template-list.js.map +1 -0
- package/dist-client/pages/issue/issue-list-page.d.ts +1 -2
- package/dist-client/pages/issue/issue-list-page.js +1 -2
- package/dist-client/pages/issue/issue-list-page.js.map +1 -1
- package/dist-client/pages/project-checklist/project-checklist-management.d.ts +50 -0
- package/dist-client/pages/project-checklist/project-checklist-management.js +910 -0
- package/dist-client/pages/project-checklist/project-checklist-management.js.map +1 -0
- package/dist-client/pages/project-report/project-report-list-page.d.ts +1 -2
- package/dist-client/pages/project-report/project-report-list-page.js +1 -2
- package/dist-client/pages/project-report/project-report-list-page.js.map +1 -1
- package/dist-client/pages/supervisor/supervisor-list-page.d.ts +1 -2
- package/dist-client/pages/supervisor/supervisor-list-page.js +1 -2
- 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 +18 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/stt/speech-to-text.d.ts +13 -8
- package/dist-client/stt/speech-to-text.js +282 -40
- package/dist-client/stt/speech-to-text.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/action-plan/action-plan-mutation.js +5 -6
- package/dist-server/service/action-plan/action-plan-mutation.js.map +1 -1
- package/dist-server/service/action-plan/action-plan-query.d.ts +2 -2
- package/dist-server/service/action-plan/action-plan-query.js +5 -11
- package/dist-server/service/action-plan/action-plan-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.d.ts +2 -3
- package/dist-server/service/building-inspection/building-inspection-mutation.js +77 -39
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-query.d.ts +5 -7
- package/dist-server/service/building-inspection/building-inspection-query.js +54 -52
- package/dist-server/service/building-inspection/building-inspection-query.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection-type.d.ts +26 -7
- package/dist-server/service/building-inspection/building-inspection-type.js +92 -13
- package/dist-server/service/building-inspection/building-inspection-type.js.map +1 -1
- package/dist-server/service/building-inspection/building-inspection.d.ts +5 -0
- package/dist-server/service/building-inspection/building-inspection.js +37 -4
- package/dist-server/service/building-inspection/building-inspection.js.map +1 -1
- package/dist-server/service/building-inspection/index.d.ts +3 -4
- package/dist-server/service/building-inspection/index.js +10 -3
- package/dist-server/service/building-inspection/index.js.map +1 -1
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.d.ts +6 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js +56 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-mutation.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.d.ts +16 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js +171 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-query.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.d.ts +23 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js +90 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog-type.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.d.ts +33 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js +132 -0
- package/dist-server/service/building-inspection-daily-worklog/building-inspection-daily-worklog.js.map +1 -0
- package/dist-server/service/building-inspection-daily-worklog/index.d.ts +5 -0
- package/dist-server/service/building-inspection-daily-worklog/index.js +9 -0
- package/dist-server/service/building-inspection-daily-worklog/index.js.map +1 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-query.d.ts +16 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-query.js +120 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-query.js.map +1 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-type.d.ts +5 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-type.js +21 -0
- package/dist-server/service/building-inspection-history/building-inspection-history-type.js.map +1 -0
- package/dist-server/service/building-inspection-history/building-inspection-history.d.ts +35 -0
- package/dist-server/service/building-inspection-history/building-inspection-history.js +162 -0
- package/dist-server/service/building-inspection-history/building-inspection-history.js.map +1 -0
- package/dist-server/service/building-inspection-history/event-subscriber.d.ts +7 -0
- package/dist-server/service/building-inspection-history/event-subscriber.js +21 -0
- package/dist-server/service/building-inspection-history/event-subscriber.js.map +1 -0
- package/dist-server/service/building-inspection-history/index.d.ts +6 -0
- package/dist-server/service/building-inspection-history/index.js +10 -0
- package/dist-server/service/building-inspection-history/index.js.map +1 -0
- package/dist-server/service/checklist/checklist-mutation.d.ts +0 -5
- package/dist-server/service/checklist/checklist-mutation.js +1 -67
- package/dist-server/service/checklist/checklist-mutation.js.map +1 -1
- package/dist-server/service/checklist/checklist-query.d.ts +7 -0
- package/dist-server/service/checklist/checklist-query.js +83 -0
- package/dist-server/service/checklist/checklist-query.js.map +1 -1
- package/dist-server/service/checklist/checklist-type.d.ts +0 -13
- package/dist-server/service/checklist/checklist-type.js +1 -49
- package/dist-server/service/checklist/checklist-type.js.map +1 -1
- package/dist-server/service/checklist/checklist.d.ts +28 -3
- package/dist-server/service/checklist/checklist.js +89 -15
- package/dist-server/service/checklist/checklist.js.map +1 -1
- package/dist-server/service/checklist/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist/event-subscriber.js +21 -0
- package/dist-server/service/checklist/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist/index.d.ts +1 -2
- package/dist-server/service/checklist/index.js +1 -2
- package/dist-server/service/checklist/index.js.map +1 -1
- package/dist-server/service/checklist-history/checklist-history-query.d.ts +11 -0
- package/dist-server/service/checklist-history/checklist-history-query.js +77 -0
- package/dist-server/service/checklist-history/checklist-history-query.js.map +1 -0
- package/dist-server/service/checklist-history/checklist-history-type.d.ts +5 -0
- package/dist-server/service/checklist-history/checklist-history-type.js +21 -0
- package/dist-server/service/checklist-history/checklist-history-type.js.map +1 -0
- package/dist-server/service/{checklist → checklist-history}/checklist-history.d.ts +19 -1
- package/dist-server/service/{checklist → checklist-history}/checklist-history.js +97 -14
- package/dist-server/service/checklist-history/checklist-history.js.map +1 -0
- package/dist-server/service/checklist-history/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist-history/event-subscriber.js +21 -0
- package/dist-server/service/checklist-history/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist-history/index.d.ts +6 -0
- package/dist-server/service/checklist-history/index.js +10 -0
- package/dist-server/service/checklist-history/index.js.map +1 -0
- package/dist-server/service/checklist-item/checklist-item-query.d.ts +1 -1
- package/dist-server/service/checklist-item/checklist-item-query.js +5 -3
- package/dist-server/service/checklist-item/checklist-item-query.js.map +1 -1
- package/dist-server/service/checklist-item/index.d.ts +0 -1
- package/dist-server/service/checklist-item/index.js +1 -2
- package/dist-server/service/checklist-item/index.js.map +1 -1
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.d.ts +1 -0
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js +33 -6
- package/dist-server/service/checklist-item-comment/checklist-item-comment-mutation.js.map +1 -1
- package/dist-server/service/checklist-item-history/checklist-item-history-query.d.ts +16 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-query.js +123 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-query.js.map +1 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-type.d.ts +5 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-type.js +21 -0
- package/dist-server/service/checklist-item-history/checklist-item-history-type.js.map +1 -0
- package/dist-server/service/checklist-item-history/checklist-item-history.d.ts +25 -0
- package/dist-server/service/checklist-item-history/checklist-item-history.js +123 -0
- package/dist-server/service/checklist-item-history/checklist-item-history.js.map +1 -0
- package/dist-server/service/checklist-item-history/event-subscriber.d.ts +7 -0
- package/dist-server/service/checklist-item-history/event-subscriber.js +21 -0
- package/dist-server/service/checklist-item-history/event-subscriber.js.map +1 -0
- package/dist-server/service/checklist-item-history/index.d.ts +6 -0
- package/dist-server/service/checklist-item-history/index.js +10 -0
- package/dist-server/service/checklist-item-history/index.js.map +1 -0
- package/dist-server/service/checklist-template/checklist-template-query.d.ts +1 -1
- package/dist-server/service/checklist-template/checklist-template-query.js +2 -5
- package/dist-server/service/checklist-template/checklist-template-query.js.map +1 -1
- package/dist-server/service/checklist-template-item/checklist-template-item-mutation.js +13 -1
- 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-type.d.ts +3 -0
- package/dist-server/service/checklist-template-item/checklist-template-item-type.js +9 -0
- 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.d.ts +7 -0
- package/dist-server/service/checklist-template-item/checklist-template-item.js +22 -2
- package/dist-server/service/checklist-template-item/checklist-template-item.js.map +1 -1
- package/dist-server/service/checklist-template-item/spec-matching-service.d.ts +2 -0
- package/dist-server/service/checklist-template-item/spec-matching-service.js +51 -0
- package/dist-server/service/checklist-template-item/spec-matching-service.js.map +1 -0
- package/dist-server/service/checklist-type/checklist-type-query.d.ts +1 -1
- package/dist-server/service/checklist-type/checklist-type-query.js +2 -5
- package/dist-server/service/checklist-type/checklist-type-query.js.map +1 -1
- package/dist-server/service/construction-checklist-template/construction-checklist-template-mutation.d.ts +7 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-mutation.js +107 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-mutation.js.map +1 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-query.d.ts +10 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-query.js +62 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-query.js.map +1 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-type.d.ts +11 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-type.js +43 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template-type.js.map +1 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template.d.ts +18 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template.js +80 -0
- package/dist-server/service/construction-checklist-template/construction-checklist-template.js.map +1 -0
- package/dist-server/service/construction-checklist-template/index.d.ts +5 -0
- package/dist-server/service/construction-checklist-template/index.js +9 -0
- package/dist-server/service/construction-checklist-template/index.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-mutation.d.ts +6 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-mutation.js +60 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-mutation.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-query.d.ts +9 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-query.js +53 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-query.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-type.d.ts +17 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-type.js +67 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item-type.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item.d.ts +24 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item.js +113 -0
- package/dist-server/service/construction-checklist-template-item/construction-checklist-template-item.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/index.d.ts +5 -0
- package/dist-server/service/construction-checklist-template-item/index.js +9 -0
- package/dist-server/service/construction-checklist-template-item/index.js.map +1 -0
- package/dist-server/service/construction-checklist-template-item/spec-matching-service.d.ts +2 -0
- package/dist-server/service/construction-checklist-template-item/spec-matching-service.js +50 -0
- package/dist-server/service/construction-checklist-template-item/spec-matching-service.js.map +1 -0
- package/dist-server/service/index.d.ts +8 -1
- package/dist-server/service/index.js +38 -3
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/issue/issue-mutation.js +5 -6
- package/dist-server/service/issue/issue-mutation.js.map +1 -1
- package/dist-server/service/issue/issue-query.d.ts +2 -2
- package/dist-server/service/issue/issue-query.js +5 -11
- package/dist-server/service/issue/issue-query.js.map +1 -1
- package/dist-server/service/project-checklist/index.d.ts +5 -0
- package/dist-server/service/project-checklist/index.js +9 -0
- package/dist-server/service/project-checklist/index.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist-mutation.d.ts +7 -0
- package/dist-server/service/project-checklist/project-checklist-mutation.js +109 -0
- package/dist-server/service/project-checklist/project-checklist-mutation.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist-query.d.ts +12 -0
- package/dist-server/service/project-checklist/project-checklist-query.js +76 -0
- package/dist-server/service/project-checklist/project-checklist-query.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist-type.d.ts +18 -0
- package/dist-server/service/project-checklist/project-checklist-type.js +69 -0
- package/dist-server/service/project-checklist/project-checklist-type.js.map +1 -0
- package/dist-server/service/project-checklist/project-checklist.d.ts +20 -0
- package/dist-server/service/project-checklist/project-checklist.js +90 -0
- package/dist-server/service/project-checklist/project-checklist.js.map +1 -0
- package/dist-server/service/project-checklist-item/index.d.ts +4 -0
- package/dist-server/service/project-checklist-item/index.js +9 -0
- package/dist-server/service/project-checklist-item/index.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-mutation.d.ts +2 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-mutation.js +13 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-mutation.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-query.d.ts +5 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-query.js +34 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-query.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-type.d.ts +5 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-type.js +21 -0
- package/dist-server/service/project-checklist-item/project-checklist-item-type.js.map +1 -0
- package/dist-server/service/project-checklist-item/project-checklist-item.d.ts +17 -0
- package/dist-server/service/project-checklist-item/project-checklist-item.js +82 -0
- package/dist-server/service/project-checklist-item/project-checklist-item.js.map +1 -0
- package/dist-server/service/project-report/project-report-mutation.js +5 -6
- package/dist-server/service/project-report/project-report-mutation.js.map +1 -1
- package/dist-server/service/project-report/project-report-query.d.ts +2 -2
- package/dist-server/service/project-report/project-report-query.js +5 -11
- package/dist-server/service/project-report/project-report-query.js.map +1 -1
- package/dist-server/service/project-report/project-report.d.ts +0 -2
- package/dist-server/service/project-report/project-report.js +0 -6
- package/dist-server/service/project-report/project-report.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-mutation.js +5 -6
- package/dist-server/service/supervisor/supervisor-mutation.js.map +1 -1
- package/dist-server/service/supervisor/supervisor-query.d.ts +2 -2
- package/dist-server/service/supervisor/supervisor-query.js +5 -11
- package/dist-server/service/supervisor/supervisor-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/things-factory.config.js +9 -1
- package/dist-server/service/building-inspection/building-inspection-history.d.ts +0 -17
- package/dist-server/service/building-inspection/building-inspection-history.js +0 -86
- package/dist-server/service/building-inspection/building-inspection-history.js.map +0 -1
- package/dist-server/service/checklist/checklist-history.js.map +0 -1
|
@@ -23,10 +23,10 @@ let ActionPlanMutation = class ActionPlanMutation {
|
|
|
23
23
|
return result;
|
|
24
24
|
}
|
|
25
25
|
async updateActionPlan(id, patch, context) {
|
|
26
|
-
const {
|
|
26
|
+
const { user, tx } = context.state;
|
|
27
27
|
const repository = tx.getRepository(action_plan_1.ActionPlan);
|
|
28
28
|
const actionPlan = await repository.findOne({
|
|
29
|
-
where: {
|
|
29
|
+
where: { id }
|
|
30
30
|
});
|
|
31
31
|
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, actionPlan), patch), { updater: user }));
|
|
32
32
|
if (patch.thumbnail) {
|
|
@@ -84,15 +84,14 @@ let ActionPlanMutation = class ActionPlanMutation {
|
|
|
84
84
|
return results;
|
|
85
85
|
}
|
|
86
86
|
async deleteActionPlan(id, context) {
|
|
87
|
-
const {
|
|
88
|
-
await tx.getRepository(action_plan_1.ActionPlan).delete({
|
|
87
|
+
const { tx } = context.state;
|
|
88
|
+
await tx.getRepository(action_plan_1.ActionPlan).delete({ id });
|
|
89
89
|
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
|
90
90
|
return true;
|
|
91
91
|
}
|
|
92
92
|
async deleteActionPlans(ids, context) {
|
|
93
|
-
const {
|
|
93
|
+
const { tx } = context.state;
|
|
94
94
|
await tx.getRepository(action_plan_1.ActionPlan).delete({
|
|
95
|
-
domain: { id: domain.id },
|
|
96
95
|
id: (0, typeorm_1.In)(ids)
|
|
97
96
|
});
|
|
98
97
|
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-plan-mutation.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+CAA0C;AAC1C,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAwB;QAClG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KA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E,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAYP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IAC7C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;6BA3LU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA4L9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { ActionPlan } from './action-plan'\nimport { NewActionPlan, ActionPlanPatch } from './action-plan-type'\n\n@Resolver(ActionPlan)\nexport class ActionPlanMutation {\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To create new ActionPlan' })\n async createActionPlan(@Arg('actionPlan') actionPlan: NewActionPlan, @Ctx() context: ResolverContext): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(ActionPlan).save({\n ...actionPlan,\n domain,\n creator: user,\n updater: user\n })\n\n if (actionPlan.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: actionPlan.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To modify ActionPlan information' })\n async updateActionPlan(\n @Arg('id') id: string,\n @Arg('patch') patch: ActionPlanPatch,\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(ActionPlan)\n const actionPlan = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...actionPlan,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [ActionPlan], { description: \"To modify multiple ActionPlans' information\" })\n async updateMultipleActionPlan(\n @Arg('patches', type => [ActionPlanPatch]) patches: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const actionPlanRepo = tx.getRepository(ActionPlan)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await actionPlanRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const actionPlan = await actionPlanRepo.findOneBy({ id: updateRecord.id })\n\n const result = await actionPlanRepo.save({\n ...actionPlan,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete ActionPlan' })\n async deleteActionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple ActionPlans' })\n async deleteActionPlans(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple ActionPlans' })\n async importActionPlans(\n @Arg('actionPlans', type => [ActionPlanPatch]) actionPlans: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n actionPlans.map(async (actionPlan: ActionPlanPatch) => {\n const createdActionPlan: ActionPlan = await tx.getRepository(ActionPlan).save({ domain, ...actionPlan })\n })\n )\n\n return true\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"action-plan-mutation.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,+CAA0C;AAC1C,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CAAoB,UAAyB,EAAS,OAAwB;QAClG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK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IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IAC7C,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAWP;6BA1LU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA2L9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { ActionPlan } from './action-plan'\nimport { NewActionPlan, ActionPlanPatch } from './action-plan-type'\n\n@Resolver(ActionPlan)\nexport class ActionPlanMutation {\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To create new ActionPlan' })\n async createActionPlan(@Arg('actionPlan') actionPlan: NewActionPlan, @Ctx() context: ResolverContext): Promise<ActionPlan> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(ActionPlan).save({\n ...actionPlan,\n domain,\n creator: user,\n updater: user\n })\n\n if (actionPlan.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: actionPlan.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => ActionPlan, { description: 'To modify ActionPlan information' })\n async updateActionPlan(\n @Arg('id') id: string,\n @Arg('patch') patch: ActionPlanPatch,\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan> {\n const { user, tx } = context.state\n\n const repository = tx.getRepository(ActionPlan)\n const actionPlan = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...actionPlan,\n ...patch,\n updater: user\n })\n\n if (patch.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: patch.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [ActionPlan], { description: \"To modify multiple ActionPlans' information\" })\n async updateMultipleActionPlan(\n @Arg('patches', type => [ActionPlanPatch]) patches: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<ActionPlan[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const actionPlanRepo = tx.getRepository(ActionPlan)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await actionPlanRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n if (newRecord.thumbnail) {\n await createAttachment(\n null,\n {\n attachment: {\n file: newRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const actionPlan = await actionPlanRepo.findOneBy({ id: updateRecord.id })\n\n const result = await actionPlanRepo.save({\n ...actionPlan,\n ...updateRecord,\n updater: user\n })\n\n if (updateRecord.thumbnail) {\n await deleteAttachmentsByRef(null, { refBys: [result.id] }, context)\n await createAttachment(\n null,\n {\n attachment: {\n file: updateRecord.thumbnail,\n refType: ActionPlan.name,\n refBy: result.id\n }\n },\n context\n )\n }\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete ActionPlan' })\n async deleteActionPlan(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({ id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple ActionPlans' })\n async deleteActionPlans(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n\n await tx.getRepository(ActionPlan).delete({\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple ActionPlans' })\n async importActionPlans(\n @Arg('actionPlans', type => [ActionPlanPatch]) actionPlans: ActionPlanPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n actionPlans.map(async (actionPlan: ActionPlanPatch) => {\n const createdActionPlan: ActionPlan = await tx.getRepository(ActionPlan).save({ domain, ...actionPlan })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -3,8 +3,8 @@ import { User } from '@things-factory/auth-base';
|
|
|
3
3
|
import { ActionPlan } from './action-plan';
|
|
4
4
|
import { ActionPlanList } from './action-plan-type';
|
|
5
5
|
export declare class ActionPlanQuery {
|
|
6
|
-
actionPlan(id: string
|
|
7
|
-
actionPlans(params: ListParam
|
|
6
|
+
actionPlan(id: string): Promise<ActionPlan>;
|
|
7
|
+
actionPlans(params: ListParam): Promise<ActionPlanList>;
|
|
8
8
|
thumbnail(actionPlan: ActionPlan): Promise<string | undefined>;
|
|
9
9
|
domain(actionPlan: ActionPlan): Promise<Domain>;
|
|
10
10
|
updater(actionPlan: ActionPlan): Promise<User>;
|
|
@@ -9,16 +9,13 @@ const auth_base_1 = require("@things-factory/auth-base");
|
|
|
9
9
|
const action_plan_1 = require("./action-plan");
|
|
10
10
|
const action_plan_type_1 = require("./action-plan-type");
|
|
11
11
|
let ActionPlanQuery = class ActionPlanQuery {
|
|
12
|
-
async actionPlan(id
|
|
13
|
-
const { domain } = context.state;
|
|
12
|
+
async actionPlan(id) {
|
|
14
13
|
return await (0, shell_1.getRepository)(action_plan_1.ActionPlan).findOne({
|
|
15
|
-
where: {
|
|
14
|
+
where: { id }
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
|
-
async actionPlans(params
|
|
19
|
-
const { domain } = context.state;
|
|
17
|
+
async actionPlans(params) {
|
|
20
18
|
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
21
|
-
domain,
|
|
22
19
|
params,
|
|
23
20
|
repository: await (0, shell_1.getRepository)(action_plan_1.ActionPlan),
|
|
24
21
|
searchables: ['name', 'description']
|
|
@@ -29,7 +26,6 @@ let ActionPlanQuery = class ActionPlanQuery {
|
|
|
29
26
|
async thumbnail(actionPlan) {
|
|
30
27
|
const attachment = await (0, shell_1.getRepository)(attachment_base_1.Attachment).findOne({
|
|
31
28
|
where: {
|
|
32
|
-
domain: { id: actionPlan.domainId },
|
|
33
29
|
refType: action_plan_1.ActionPlan.name,
|
|
34
30
|
refBy: actionPlan.id
|
|
35
31
|
}
|
|
@@ -50,17 +46,15 @@ exports.ActionPlanQuery = ActionPlanQuery;
|
|
|
50
46
|
tslib_1.__decorate([
|
|
51
47
|
(0, type_graphql_1.Query)(returns => action_plan_1.ActionPlan, { nullable: true, description: 'To fetch a ActionPlan' }),
|
|
52
48
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
53
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
54
49
|
tslib_1.__metadata("design:type", Function),
|
|
55
|
-
tslib_1.__metadata("design:paramtypes", [String
|
|
50
|
+
tslib_1.__metadata("design:paramtypes", [String]),
|
|
56
51
|
tslib_1.__metadata("design:returntype", Promise)
|
|
57
52
|
], ActionPlanQuery.prototype, "actionPlan", null);
|
|
58
53
|
tslib_1.__decorate([
|
|
59
54
|
(0, type_graphql_1.Query)(returns => action_plan_type_1.ActionPlanList, { description: 'To fetch multiple ActionPlans' }),
|
|
60
55
|
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
61
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
62
56
|
tslib_1.__metadata("design:type", Function),
|
|
63
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam
|
|
57
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam]),
|
|
64
58
|
tslib_1.__metadata("design:returntype", Promise)
|
|
65
59
|
], ActionPlanQuery.prototype, "actionPlans", null);
|
|
66
60
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-plan-query.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU
|
|
1
|
+
{"version":3,"file":"action-plan-query.js","sourceRoot":"","sources":["../../../server/service/action-plan/action-plan-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAC9F,qEAA4D;AAC5D,iDAAuG;AACvG,yDAAgD;AAChD,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU;QACpC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAS,MAAiB;QACzC,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC;YACjD,MAAM;YACN,UAAU,EAAE,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC;YAC3C,WAAW,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SACrC,CAAC,CAAA;QAEF,MAAM,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K,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAChE,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAS,iBAAS;;kDAU1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;gDAS7C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;0BA9CU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CA+C3B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\nimport { Attachment } from '@things-factory/attachment-base'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { ActionPlan } from './action-plan'\nimport { ActionPlanList } from './action-plan-type'\n\n@Resolver(ActionPlan)\nexport class ActionPlanQuery {\n @Query(returns => ActionPlan!, { nullable: true, description: 'To fetch a ActionPlan' })\n async actionPlan(@Arg('id') id: string): Promise<ActionPlan> {\n return await getRepository(ActionPlan).findOne({\n where: { id }\n })\n }\n\n @Query(returns => ActionPlanList, { description: 'To fetch multiple ActionPlans' })\n async actionPlans(@Args() params: ListParam): Promise<ActionPlanList> {\n const queryBuilder = getQueryBuilderFromListParams({\n params,\n repository: await getRepository(ActionPlan),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => String)\n async thumbnail(@Root() actionPlan: ActionPlan): Promise<string | undefined> {\n const attachment: Attachment = await getRepository(Attachment).findOne({\n where: {\n refType: ActionPlan.name,\n refBy: actionPlan.id\n }\n })\n\n return attachment?.fullpath\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() actionPlan: ActionPlan): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: actionPlan.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() actionPlan: ActionPlan): Promise<User> {\n return await getRepository(User).findOneBy({ id: actionPlan.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() actionPlan: ActionPlan): Promise<User> {\n return await getRepository(User).findOneBy({ id: actionPlan.creatorId })\n }\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BuildingInspection } from './building-inspection';
|
|
2
|
-
import { NewBuildingInspection,
|
|
2
|
+
import { NewBuildingInspection, UpdateBuildingInspection, UpdateBuildingInspectionSubmitType } from './building-inspection-type';
|
|
3
3
|
export declare class BuildingInspectionMutation {
|
|
4
4
|
createBuildingInspection(patch: NewBuildingInspection, context: ResolverContext): Promise<BuildingInspection>;
|
|
5
5
|
updateBuildingInspectionChecklist(buildingInspection: UpdateBuildingInspectionSubmitType, context: ResolverContext): Promise<boolean>;
|
|
6
|
-
updateBuildingInspection(patch:
|
|
6
|
+
updateBuildingInspection(patch: UpdateBuildingInspection, context: ResolverContext): Promise<BuildingInspection>;
|
|
7
7
|
deleteBuildingInspections(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
8
8
|
applyToAllBuildingInspection(buildingInspectionId: string, context: ResolverContext): Promise<boolean>;
|
|
9
|
-
getRecentDocumentNoByBuildingLevelId(buildingLevelId: string): Promise<string>;
|
|
10
9
|
}
|
|
@@ -12,6 +12,7 @@ const checklist_item_1 = require("../checklist-item/checklist-item");
|
|
|
12
12
|
const shell_1 = require("@things-factory/shell");
|
|
13
13
|
const building_complex_1 = require("@dssp/building-complex");
|
|
14
14
|
const env_1 = require("@things-factory/env");
|
|
15
|
+
const checklist_2 = require("../checklist/checklist");
|
|
15
16
|
const projectType = env_1.config.get('projectType', building_inspection_1.ProjectType.DSSP);
|
|
16
17
|
let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
17
18
|
async createBuildingInspection(patch, context) {
|
|
@@ -21,12 +22,12 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
21
22
|
const checklistRepository = tx.getRepository(checklist_1.Checklist);
|
|
22
23
|
const checklistItemRepository = tx.getRepository(checklist_item_1.ChecklistItem);
|
|
23
24
|
// 1. 벨리데이션
|
|
24
|
-
if (!
|
|
25
|
-
throw new Error('
|
|
25
|
+
if (!checklist.constructionType)
|
|
26
|
+
throw new Error('공종 타입이 없습니다.');
|
|
27
|
+
if (!checklist.constructionDetailType)
|
|
28
|
+
throw new Error('상세 공종 타입이 없습니다.');
|
|
26
29
|
if (!checklist.name)
|
|
27
30
|
throw new Error('체크리스트 이름이 없습니다.');
|
|
28
|
-
if (!checklist.location)
|
|
29
|
-
throw new Error('위치가 없습니다.');
|
|
30
31
|
if (checklistItem.length === 0)
|
|
31
32
|
throw new Error('체크리스트 아이템이 없습니다.');
|
|
32
33
|
if (projectType === building_inspection_1.ProjectType.DSSP) {
|
|
@@ -34,21 +35,27 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
34
35
|
throw new Error('셀 좌표가 없습니다.');
|
|
35
36
|
if (!managerId)
|
|
36
37
|
throw new Error('담당자가 없습니다.');
|
|
38
|
+
if (!buildingLevelId)
|
|
39
|
+
throw new Error('층 아이디가 없습니다.');
|
|
40
|
+
if (!checklist.location)
|
|
41
|
+
throw new Error('위치가 없습니다.');
|
|
37
42
|
}
|
|
38
43
|
else if (projectType === building_inspection_1.ProjectType.DCSP) {
|
|
39
|
-
if (!checklist.constructionType)
|
|
40
|
-
throw new Error('공종 타입이 없습니다.');
|
|
41
|
-
if (!checklist.constructionDetailType)
|
|
42
|
-
throw new Error('상세 공종 타입이 없습니다.');
|
|
43
44
|
if (!checklist.inspectionDrawingType)
|
|
44
45
|
throw new Error('검측 도면 타입이 없습니다.');
|
|
45
46
|
if (checklist.inspectionParts.length === 0)
|
|
46
47
|
throw new Error('검측 부위가 없습니다.');
|
|
48
|
+
if (!buildingLevelId)
|
|
49
|
+
throw new Error('층 아이디가 없습니다.');
|
|
50
|
+
if (!checklist.location)
|
|
51
|
+
throw new Error('위치가 없습니다.');
|
|
47
52
|
}
|
|
48
53
|
// 2. checklist 저장
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
54
|
+
const checklistDocumentNo = await getRecentDocumentNoByBuildingLevelId(buildingLevelId, checklist_1.DocumentNoType.CHECKLIST, tx);
|
|
55
|
+
const inspectionRequestDocumentNo = checklistDocumentNo.replace(`검측 제${checklist_1.DocumentNoType.CHECKLIST}-`, `검측 제${checklist_1.DocumentNoType.INSPECTION_REQUEST}-`);
|
|
56
|
+
const inspectionResultDocumentNo = checklistDocumentNo.replace(`검측 제${checklist_1.DocumentNoType.CHECKLIST}-`, `검측 제${checklist_1.DocumentNoType.INSPECTION_RESULT}-`);
|
|
57
|
+
const savedChecklist = await checklistRepository.save(Object.assign(Object.assign({}, checklist), { projectType, checklistReferenceType: checklist_2.ChecklistReferenceType.INSPECTION, documentNo: checklistDocumentNo, inspectionRequestDocumentNo,
|
|
58
|
+
inspectionResultDocumentNo, creator: user, updater: user }));
|
|
52
59
|
// 3. checklistItem 저장
|
|
53
60
|
const checklistItems = checklistItem.map((item, idx) => ({
|
|
54
61
|
name: item.name,
|
|
@@ -78,7 +85,7 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
78
85
|
// 검측 상태 변경 & 체크리스트 갱신
|
|
79
86
|
async updateBuildingInspectionChecklist(buildingInspection, context) {
|
|
80
87
|
const { user, tx } = context.state;
|
|
81
|
-
const { id: buildingInspectionId, checklist, checklistItem } = buildingInspection;
|
|
88
|
+
const { id: buildingInspectionId, memo, requestDate, checklist, checklistItem } = buildingInspection;
|
|
82
89
|
const buildingInspectionRepo = tx.getRepository(building_inspection_1.BuildingInspection);
|
|
83
90
|
const checklistRepo = tx.getRepository(checklist_1.Checklist);
|
|
84
91
|
const checklistItemRepo = tx.getRepository(checklist_item_1.ChecklistItem);
|
|
@@ -88,6 +95,9 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
88
95
|
status == building_inspection_2.BuildingInspectionStatus.OVERALL_WAIT ||
|
|
89
96
|
status == building_inspection_2.BuildingInspectionStatus.FAIL;
|
|
90
97
|
let inspectionStatus = null;
|
|
98
|
+
let signedUserType = null; // 싸인을 한 유저 타입
|
|
99
|
+
let inspectionRequestData = {};
|
|
100
|
+
let inspectionResultData = {};
|
|
91
101
|
// 1. 벨리데이션
|
|
92
102
|
if (!buildingInspectionId)
|
|
93
103
|
throw new Error('검측 아이디가 없습니다.');
|
|
@@ -117,12 +127,18 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
117
127
|
else if (isPassed && (status === building_inspection_2.BuildingInspectionStatus.WAIT || status === building_inspection_2.BuildingInspectionStatus.FAIL)) {
|
|
118
128
|
// 2. 검측이 합격이면서 공종 시공자 스탭 = 상태는 총괄 시공자 스탭으로
|
|
119
129
|
inspectionStatus = building_inspection_2.BuildingInspectionStatus.OVERALL_WAIT;
|
|
130
|
+
signedUserType = 'taskConstructor';
|
|
120
131
|
}
|
|
121
132
|
else if (isPassed && status === building_inspection_2.BuildingInspectionStatus.OVERALL_WAIT) {
|
|
122
133
|
// 3. 검측이 합격이면서 총괄 시공자 스탭 = 상태는 공종 감리자 스탭으로, 감리자 싸인은 모두 초기화
|
|
123
134
|
inspectionStatus = building_inspection_2.BuildingInspectionStatus.REQUEST;
|
|
124
135
|
checklist.overallSupervisorySignature = null;
|
|
125
136
|
checklist.taskSupervisorySignature = null;
|
|
137
|
+
signedUserType = 'overallConstructor';
|
|
138
|
+
inspectionRequestData = {
|
|
139
|
+
inspectionRequestMemo: checklist.inspectionRequestMemo,
|
|
140
|
+
inspectionRequestUpdatedAt: new Date()
|
|
141
|
+
};
|
|
126
142
|
}
|
|
127
143
|
}
|
|
128
144
|
else {
|
|
@@ -147,25 +163,34 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
147
163
|
else if (isPassed && status === building_inspection_2.BuildingInspectionStatus.REQUEST) {
|
|
148
164
|
// 2. 검측이 합격이면서 공종 감리자 스탭 = 상태는 총괄 감리자 스탭으로
|
|
149
165
|
inspectionStatus = building_inspection_2.BuildingInspectionStatus.OVERALL_REQUEST;
|
|
166
|
+
signedUserType = 'taskSupervisory';
|
|
150
167
|
}
|
|
151
168
|
else if (isPassed && status === building_inspection_2.BuildingInspectionStatus.OVERALL_REQUEST) {
|
|
152
169
|
// 3. 검측이 합격이면서 총괄 감리자 스탭 = 상태는 합격으로
|
|
153
170
|
inspectionStatus = building_inspection_2.BuildingInspectionStatus.PASS;
|
|
171
|
+
signedUserType = 'overallSupervisory';
|
|
172
|
+
inspectionResultData = {
|
|
173
|
+
inspectionResultStatus: checklist.inspectionResultStatus,
|
|
174
|
+
inspectionResultMemo: checklist.inspectionResultMemo,
|
|
175
|
+
inspectionResultType: checklist.inspectionResultType,
|
|
176
|
+
inspectionResultUpdatedAt: new Date()
|
|
177
|
+
};
|
|
154
178
|
}
|
|
155
179
|
}
|
|
156
180
|
// 2. buildingInspection 저장
|
|
157
|
-
await buildingInspectionRepo.save(Object.assign(Object.assign({}, oldBuildingInspection), { status: inspectionStatus,
|
|
181
|
+
await buildingInspectionRepo.save(Object.assign(Object.assign(Object.assign(Object.assign({}, oldBuildingInspection), { status: inspectionStatus, failCount: inspectionStatus === building_inspection_2.BuildingInspectionStatus.FAIL
|
|
182
|
+
? (oldBuildingInspection.failCount || 0) + 1
|
|
183
|
+
: oldBuildingInspection.failCount || 0 }), (requestDate !== undefined && { requestDate })), { memo: memo, updater: user }));
|
|
158
184
|
// 3. checklist 저장
|
|
159
185
|
const oldChecklist = await checklistRepo.findOneBy({ id: checklist.id });
|
|
160
186
|
const inspectionDateField = isConstructor ? 'constructionInspectionDate' : 'supervisorInspectionDate';
|
|
161
|
-
|
|
187
|
+
const signedUser = signedUserType ? { [signedUserType]: user } : {};
|
|
188
|
+
await checklistRepo.save(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, oldChecklist), { [inspectionDateField]: new Date(), overallConstructorSignature: checklist.overallConstructorSignature, taskConstructorSignature: checklist.taskConstructorSignature, overallSupervisorySignature: checklist.overallSupervisorySignature, taskSupervisorySignature: checklist.taskSupervisorySignature }), signedUser), inspectionRequestData), inspectionResultData), { updater: user }));
|
|
162
189
|
// 4. checklistItem 저장
|
|
163
190
|
for (let item of checklistItem) {
|
|
164
191
|
const confirmStatusField = isConstructor ? 'constructionConfirmStatus' : 'supervisoryConfirmStatus';
|
|
165
|
-
await checklistItemRepo.
|
|
166
|
-
|
|
167
|
-
updater: user
|
|
168
|
-
});
|
|
192
|
+
const existingItem = await checklistItemRepo.findOneBy({ id: item.id });
|
|
193
|
+
await checklistItemRepo.save(Object.assign(Object.assign({}, existingItem), { [confirmStatusField]: item[confirmStatusField], updater: user }));
|
|
169
194
|
}
|
|
170
195
|
return true;
|
|
171
196
|
}
|
|
@@ -259,26 +284,6 @@ let BuildingInspectionMutation = class BuildingInspectionMutation {
|
|
|
259
284
|
}
|
|
260
285
|
return true;
|
|
261
286
|
}
|
|
262
|
-
async getRecentDocumentNoByBuildingLevelId(buildingLevelId) {
|
|
263
|
-
var _a, _b;
|
|
264
|
-
const buildingLevel = await (0, shell_1.getRepository)(building_complex_1.BuildingLevel).findOne({
|
|
265
|
-
where: { id: buildingLevelId },
|
|
266
|
-
relations: ['building']
|
|
267
|
-
});
|
|
268
|
-
const buildingName = ((_b = (_a = buildingLevel.building.name.match(/\d+/g)) === null || _a === void 0 ? void 0 : _a.join('')) === null || _b === void 0 ? void 0 : _b.padStart(4, '0')) || '0000';
|
|
269
|
-
const floorName = buildingLevel.floor.toString().padStart(3, '0');
|
|
270
|
-
const latestChecklist = await (0, shell_1.getRepository)(checklist_1.Checklist)
|
|
271
|
-
.createQueryBuilder('c')
|
|
272
|
-
.where('c.document_no LIKE :pattern', { pattern: `${buildingName}-${floorName}-%` })
|
|
273
|
-
.orderBy('c.created_at', 'DESC')
|
|
274
|
-
.getOne();
|
|
275
|
-
let documentNo = '000001';
|
|
276
|
-
if (latestChecklist) {
|
|
277
|
-
const lastNo = latestChecklist.documentNo.split('-')[2];
|
|
278
|
-
documentNo = (Number(lastNo) + 1).toString().padStart(6, '0');
|
|
279
|
-
}
|
|
280
|
-
return `${buildingName}-${floorName}-${documentNo}`;
|
|
281
|
-
}
|
|
282
287
|
};
|
|
283
288
|
exports.BuildingInspectionMutation = BuildingInspectionMutation;
|
|
284
289
|
tslib_1.__decorate([
|
|
@@ -305,7 +310,7 @@ tslib_1.__decorate([
|
|
|
305
310
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('patch')),
|
|
306
311
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
307
312
|
tslib_1.__metadata("design:type", Function),
|
|
308
|
-
tslib_1.__metadata("design:paramtypes", [building_inspection_type_1.
|
|
313
|
+
tslib_1.__metadata("design:paramtypes", [building_inspection_type_1.UpdateBuildingInspection, Object]),
|
|
309
314
|
tslib_1.__metadata("design:returntype", Promise)
|
|
310
315
|
], BuildingInspectionMutation.prototype, "updateBuildingInspection", null);
|
|
311
316
|
tslib_1.__decorate([
|
|
@@ -329,4 +334,37 @@ tslib_1.__decorate([
|
|
|
329
334
|
exports.BuildingInspectionMutation = BuildingInspectionMutation = tslib_1.__decorate([
|
|
330
335
|
(0, type_graphql_1.Resolver)(building_inspection_1.BuildingInspection)
|
|
331
336
|
], BuildingInspectionMutation);
|
|
337
|
+
async function getRecentDocumentNoByBuildingLevelId(buildingLevelId, type, tx) {
|
|
338
|
+
const project = await tx
|
|
339
|
+
.createQueryBuilder()
|
|
340
|
+
.select('p.documentNaming', 'documentNaming')
|
|
341
|
+
.addSelect('bc.id', 'buildingComplexId')
|
|
342
|
+
.from('projects', 'p')
|
|
343
|
+
.innerJoin('building_complexes', 'bc', 'bc.id = p.building_complex_id')
|
|
344
|
+
.innerJoin('buildings', 'b', 'b.building_complex_id = bc.id')
|
|
345
|
+
.innerJoin('building_levels', 'bl', 'bl.building_id = b.id')
|
|
346
|
+
.where('bl.id = :buildingLevelId', { buildingLevelId })
|
|
347
|
+
.getRawOne();
|
|
348
|
+
const latestChecklist = await tx
|
|
349
|
+
.getRepository(checklist_1.Checklist)
|
|
350
|
+
.createQueryBuilder('c')
|
|
351
|
+
.innerJoin('c.buildingInspection', 'bi')
|
|
352
|
+
.innerJoin('bi.buildingLevel', 'bl')
|
|
353
|
+
.innerJoin('bl.building', 'b')
|
|
354
|
+
.where('b.building_complex_id = :buildingComplexId', { buildingComplexId: project.buildingComplexId })
|
|
355
|
+
.andWhere('c.document_no LIKE :pattern', { pattern: `${project.documentNaming} 검측 제${type}-%` })
|
|
356
|
+
.orderBy('c.created_at', 'DESC')
|
|
357
|
+
.getOne();
|
|
358
|
+
// 4. 시퀀스 번호 생성 (5자리)
|
|
359
|
+
let sequence = '00001';
|
|
360
|
+
if (latestChecklist) {
|
|
361
|
+
const documentNoPattern = new RegExp(`${project.documentNaming} 검측 제${type}-(\\d{5})호`);
|
|
362
|
+
const match = latestChecklist.documentNo.match(documentNoPattern);
|
|
363
|
+
if (match) {
|
|
364
|
+
sequence = (Number(match[1]) + 1).toString().padStart(5, '0');
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
// 5. 최종 문서 번호 생성
|
|
368
|
+
return `${project.documentNaming} 검측 제${type}-${sequence}호`;
|
|
369
|
+
}
|
|
332
370
|
//# sourceMappingURL=building-inspection-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"building-inspection-mutation.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,+DAAuE;AACvE,yEAImC;AACnC,+DAAgE;AAChE,sDAAkD;AAClD,qEAAgE;AAChE,iDAAqD;AACrD,6DAAsD;AACtD,6CAA4C;AAC5C,MAAM,WAAW,GAAG,YAAM,CAAC,GAAG,CAAC,aAAa,EAAE,iCAAW,CAAC,IAAI,CAAC,CAAA;AAGxD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACd,KAA4B,EACnC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAClC,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;QACpF,MAAM,4BAA4B,GAAG,EAAE,CAAC,aAAa,CAAC,wCAAkB,CAAC,CAAA;QACzE,MAAM,mBAAmB,GAAG,EAAE,CAAC,aAAa,CAAC,qBAAS,CAAC,CAAA;QACvD,MAAM,uBAAuB,GAAG,EAAE,CAAC,aAAa,CAAC,8BAAa,CAAC,CAAA;QAE/D,WAAW;QACX,IAAI,CAAC,eAAe;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;QACrD,IAAI,CAAC,SAAS,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACvD,IAAI,CAAC,SAAS,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAA;QACrD,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAEnE,IAAI,WAAW,KAAK,iCAAW,CA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AAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAE5E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2EAiCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;IAElF,mBAAA,IAAA,kBAAG,EAAC,sBAAsB,CAAC,CAAA;IAC3B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;8EA0DP;qCAvTU,0BAA0B;IADtC,IAAA,uBAAQ,EAAC,wCAAkB,CAAC;GAChB,0BAA0B,CA+UtC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { BuildingInspection, ProjectType } from './building-inspection'\nimport {\n NewBuildingInspection,\n UpdateBuildingInspectionDrawingMarker,\n UpdateBuildingInspectionSubmitType\n} from './building-inspection-type'\nimport { BuildingInspectionStatus } from './building-inspection'\nimport { Checklist } from '../checklist/checklist'\nimport { ChecklistItem } from '../checklist-item/checklist-item'\nimport { getRepository } from '@things-factory/shell'\nimport { BuildingLevel } from '@dssp/building-complex'\nimport { config } from '@things-factory/env'\nconst projectType = config.get('projectType', ProjectType.DSSP)\n\n@Resolver(BuildingInspection)\nexport class BuildingInspectionMutation {\n @Directive('@transaction')\n @Mutation(returns => BuildingInspection, { description: 'To create Building Inspection information' })\n async createBuildingInspection(\n @Arg('patch') patch: NewBuildingInspection,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspection> {\n const { user, tx } = context.state\n const { buildingLevelId, checklist, checklistItem, cellX, cellY, managerId } = patch\n const buildingInspectionRepository = tx.getRepository(BuildingInspection)\n const checklistRepository = tx.getRepository(Checklist)\n const checklistItemRepository = tx.getRepository(ChecklistItem)\n\n // 1. 벨리데이션\n if (!buildingLevelId) throw new Error('층 아이디가 없습니다.')\n if (!checklist.name) throw new Error('체크리스트 이름이 없습니다.')\n if (!checklist.location) throw new Error('위치가 없습니다.')\n if (checklistItem.length === 0) throw new Error('체크리스트 아이템이 없습니다.')\n\n if (projectType === ProjectType.DSSP) {\n if (!cellX || !cellY) throw new Error('셀 좌표가 없습니다.')\n if (!managerId) throw new Error('담당자가 없습니다.')\n } else if (projectType === ProjectType.DCSP) {\n if (!checklist.constructionType) throw new Error('공종 타입이 없습니다.')\n if (!checklist.constructionDetailType) throw new Error('상세 공종 타입이 없습니다.')\n if (!checklist.inspectionDrawingType) throw new Error('검측 도면 타입이 없습니다.')\n if (checklist.inspectionParts.length === 0) throw new Error('검측 부위가 없습니다.')\n }\n\n // 2. checklist 저장\n const documentNo = await this.getRecentDocumentNoByBuildingLevelId(buildingLevelId)\n const savedChecklist = await checklistRepository.save({\n ...checklist,\n projectType,\n documentNo,\n creator: user,\n updater: user\n })\n\n // 3. checklistItem 저장\n const checklistItems = checklistItem.map((item, idx) => ({\n name: item.name,\n mainType: item.mainType,\n detailType: item.detailType,\n inspctionCriteria: item.inspctionCriteria,\n sequence: idx,\n checklist: savedChecklist,\n creator: user,\n updater: user\n }))\n await checklistItemRepository.save(checklistItems)\n\n // 4. buildingInspection 저장\n const result = await buildingInspectionRepository.save({\n status: BuildingInspectionStatus.WAIT,\n buildingLevel: { id: buildingLevelId },\n checklist: savedChecklist,\n projectType,\n manager: managerId ? { id: managerId } : null,\n cellX,\n cellY,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n // 검측 상태 변경 & 체크리스트 갱신\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To create Building Inspection And Checklist information' })\n async updateBuildingInspectionChecklist(\n @Arg('buildingInspection') buildingInspection: UpdateBuildingInspectionSubmitType,\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { user, tx } = context.state\n const { id: buildingInspectionId, checklist, checklistItem } = buildingInspection\n const buildingInspectionRepo = tx.getRepository(BuildingInspection)\n const checklistRepo = tx.getRepository(Checklist)\n const checklistItemRepo = tx.getRepository(ChecklistItem)\n const oldBuildingInspection = await buildingInspectionRepo.findOneBy({ id: buildingInspectionId })\n const status = oldBuildingInspection.status\n const isConstructor: boolean =\n status == BuildingInspectionStatus.WAIT ||\n status == BuildingInspectionStatus.OVERALL_WAIT ||\n status == BuildingInspectionStatus.FAIL\n let inspectionStatus = null\n\n // 1. 벨리데이션\n if (!buildingInspectionId) throw new Error('검측 아이디가 없습니다.')\n if (!status) throw new Error('검측 상태가 없습니다.')\n if (status == BuildingInspectionStatus.PASS) throw new Error('검측 상태가 수정할 수 있는 상태가 아닙니다.')\n\n if (isConstructor) {\n // 시공자 타입별 밸리데이션\n if (checklistItem.length !== checklistItem.filter(v => v.constructionConfirmStatus).length) {\n throw new Error('아이템을 모두 체크해야 합니다.')\n }\n if (status == BuildingInspectionStatus.OVERALL_WAIT && !checklist.overallConstructorSignature) {\n throw new Error('총괄 시공책임자 사인이 없습니다.')\n }\n if (status == BuildingInspectionStatus.WAIT && !checklist.taskConstructorSignature) {\n throw new Error('공종별 시공관리자 사인이 없습니다.')\n }\n\n // 시공자 상태 데이터\n const isPassed = checklistItem.length === checklistItem.filter(v => v.constructionConfirmStatus === 'T').length\n\n if (!isPassed) {\n // 1. 검측이 불햡격 = 상태는 불합격으로, 시공자 싸인은 모두 초기화\n inspectionStatus = BuildingInspectionStatus.FAIL\n checklist.overallConstructorSignature = null\n checklist.taskConstructorSignature = null\n } else if (isPassed && (status === BuildingInspectionStatus.WAIT || status === BuildingInspectionStatus.FAIL)) {\n // 2. 검측이 합격이면서 공종 시공자 스탭 = 상태는 총괄 시공자 스탭으로\n inspectionStatus = BuildingInspectionStatus.OVERALL_WAIT\n } else if (isPassed && status === BuildingInspectionStatus.OVERALL_WAIT) {\n // 3. 검측이 합격이면서 총괄 시공자 스탭 = 상태는 공종 감리자 스탭으로, 감리자 싸인은 모두 초기화\n inspectionStatus = BuildingInspectionStatus.REQUEST\n checklist.overallSupervisorySignature = null\n checklist.taskSupervisorySignature = null\n }\n } else {\n // 감리자 타입별 밸리데이션\n if (checklistItem.length !== checklistItem.filter(v => v.supervisoryConfirmStatus).length) {\n throw new Error('아이템을 모두 체크해야 합니다.')\n }\n if (status == BuildingInspectionStatus.OVERALL_REQUEST && !checklist.overallSupervisorySignature) {\n throw new Error('총괄 감리책임자 사인이 없습니다.')\n }\n if (status == BuildingInspectionStatus.REQUEST && !checklist.taskSupervisorySignature) {\n throw new Error('공종별 감리 책임자 사인이 없습니다.')\n }\n\n // 감리자 상태 데이터\n const isPassed = checklistItem.length === checklistItem.filter(v => v.supervisoryConfirmStatus === 'T').length\n if (!isPassed) {\n // 1. 검측이 불햡격 = 상태는 불합격으로, 시공자 싸인은 모두 초기화\n inspectionStatus = BuildingInspectionStatus.FAIL\n checklist.overallConstructorSignature = null\n checklist.taskConstructorSignature = null\n } else if (isPassed && status === BuildingInspectionStatus.REQUEST) {\n // 2. 검측이 합격이면서 공종 감리자 스탭 = 상태는 총괄 감리자 스탭으로\n inspectionStatus = BuildingInspectionStatus.OVERALL_REQUEST\n } else if (isPassed && status === BuildingInspectionStatus.OVERALL_REQUEST) {\n // 3. 검측이 합격이면서 총괄 감리자 스탭 = 상태는 합격으로\n inspectionStatus = BuildingInspectionStatus.PASS\n }\n }\n\n // 2. buildingInspection 저장\n await buildingInspectionRepo.save({\n ...oldBuildingInspection,\n status: inspectionStatus,\n updater: user\n })\n\n // 3. checklist 저장\n const oldChecklist = await checklistRepo.findOneBy({ id: checklist.id })\n const inspectionDateField = isConstructor ? 'constructionInspectionDate' : 'supervisorInspectionDate'\n await checklistRepo.save({\n ...oldChecklist,\n [inspectionDateField]: new Date(),\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature,\n updater: user\n })\n\n // 4. checklistItem 저장\n for (let item of checklistItem) {\n const confirmStatusField = isConstructor ? 'constructionConfirmStatus' : 'supervisoryConfirmStatus'\n await checklistItemRepo.update(item.id, {\n [confirmStatusField]: item[confirmStatusField],\n updater: user\n })\n }\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => BuildingInspection, { description: 'To update Building Inspection information' })\n async updateBuildingInspection(\n @Arg('patch') patch: UpdateBuildingInspectionDrawingMarker,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspection> {\n const { user, tx } = context.state\n const buildingInspectionRepo = tx.getRepository(BuildingInspection)\n\n // 벨리데이션\n if (!patch.id) throw new Error('검측 아이디가 없습니다.')\n\n const buildingInspection = await buildingInspectionRepo.findOneBy({ id: patch.id })\n\n // 완료 상태인 검측데이터면 삭제 못함\n if (buildingInspection.status === BuildingInspectionStatus.PASS) {\n throw new Error('완료 상태인 검측정보를 변경할 수 없습니다.')\n }\n\n const result = await buildingInspectionRepo.save({\n ...buildingInspection,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Checklists' })\n async deleteBuildingInspections(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n const buildingInspectionRepository = tx.getRepository(BuildingInspection)\n const checklistRepository = tx.getRepository(Checklist)\n const checklistItemRepository = tx.getRepository(ChecklistItem)\n\n const buildingInspections = await buildingInspectionRepository.createQueryBuilder('bi').whereInIds(ids).getMany()\n\n // 완료 상태인 검측데이터가 한개라도 있으면 삭제 못함\n if (buildingInspections.filter(bi => bi.status === BuildingInspectionStatus.PASS).length > 0) {\n throw new Error('완료 상태인 검측정보를 변경할 수 없습니다.')\n }\n\n // 검측 데이터 제거\n await buildingInspectionRepository.softDelete({\n id: In(ids)\n })\n\n // 검측 데이터의 체크 리스트 제거\n const checklistIds = buildingInspections.map(bi => bi.checklistId)\n await checklistRepository.softDelete({\n id: In(checklistIds)\n })\n\n // 검측 데이터의 체크 리스트 아이템 제거\n await checklistItemRepository\n .createQueryBuilder()\n .softDelete()\n .where('checklist_id IN (:...checklistIds)', { checklistIds })\n .execute()\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To apply to all building inspection' })\n async applyToAllBuildingInspection(\n @Arg('buildingInspectionId') buildingInspectionId: string,\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { user, tx } = context.state\n const buildingInspectionRepository = tx.getRepository(BuildingInspection)\n\n const buildingInspection = await buildingInspectionRepository.findOne({\n where: { id: buildingInspectionId },\n relations: ['buildingLevel', 'buildingLevel.building', 'checklist', 'checklist.checklistItems']\n })\n\n const checklist = buildingInspection.checklist\n const checklistItems = checklist.checklistItems\n const buildingLevels = await getRepository(BuildingLevel).find({\n where: { building: { id: buildingInspection.buildingLevel.building.id } }\n })\n\n // 해당 검측 정보가 속한 동의 모든 층에 같은 검측 데이터 등록\n for (let buildingLevel of buildingLevels) {\n // 같은 셀에 이미 검측 정보가 있으면 패스\n const existInspection = await buildingInspectionRepository.findOneBy({\n buildingLevel: { id: buildingLevel.id },\n cellX: buildingInspection.cellX,\n cellY: buildingInspection.cellY\n })\n if (existInspection) continue\n\n // 새로운 체크리스트 데이터\n const newChecklist = {\n name: checklist.name,\n location: `${buildingInspection.buildingLevel.building.name} ${buildingLevel.floor}층`,\n constructionType: checklist.constructionType,\n constructionDetailType: checklist.constructionDetailType,\n inspectionDrawingType: checklist.inspectionDrawingType,\n inspectionParts: checklist.inspectionParts\n }\n\n // 새로운 체크리스트 아이템 데이터\n const newChecklistItems = checklistItems.map(item => ({\n name: item.name,\n mainType: item.mainType,\n detailType: item.detailType,\n inspctionCriteria: item.inspctionCriteria\n }))\n\n await this.createBuildingInspection(\n {\n buildingLevelId: buildingLevel.id,\n checklist: newChecklist,\n checklistItem: newChecklistItems,\n cellX: buildingInspection.cellX,\n cellY: buildingInspection.cellY,\n managerId: buildingInspection.managerId\n },\n context\n )\n }\n\n return true\n }\n\n async getRecentDocumentNoByBuildingLevelId(buildingLevelId: string): Promise<string> {\n const buildingLevel = await getRepository(BuildingLevel).findOne({\n where: { id: buildingLevelId },\n relations: ['building']\n })\n\n const buildingName = buildingLevel.building.name.match(/\\d+/g)?.join('')?.padStart(4, '0') || '0000'\n const floorName = buildingLevel.floor.toString().padStart(3, '0')\n const latestChecklist = await getRepository(Checklist)\n .createQueryBuilder('c')\n .where('c.document_no LIKE :pattern', { pattern: `${buildingName}-${floorName}-%` })\n .orderBy('c.created_at', 'DESC')\n .getOne()\n\n let documentNo = '000001'\n if (latestChecklist) {\n const lastNo = latestChecklist.documentNo.split('-')[2]\n documentNo = (Number(lastNo) + 1).toString().padStart(6, '0')\n }\n\n return `${buildingName}-${floorName}-${documentNo}`\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"building-inspection-mutation.js","sourceRoot":"","sources":["../../../server/service/building-inspection/building-inspection-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,+DAAuE;AACvE,yEAAgI;AAChI,+DAAgE;AAChE,sDAAkE;AAClE,qEAAgE;AAChE,iDAAqD;AACrD,6DAAsD;AACtD,6CAA4C;AAC5C,sDAA+D;AAE/D,MAAM,WAAW,GAAG,YAAM,CAAC,GAAG,CAAC,aAAa,EAAE,iCAAW,CAAC,IAAI,CAAC,CAAA;AAGxD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAG/B,AAAN,KAAK,CAAC,wBAAwB,CACd,KAA4B,EACnC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAClC,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;QACpF,MAAM,4BAA4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rG,QAAQ,CAAC,6BAA6B,EAAE,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,cAAc,QAAQ,IAAI,IAAI,EAAE,CAAC;SAC/F,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;SAC/B,MAAM,EAAE,CAAA;IAEX,qBAAqB;IACrB,IAAI,QAAQ,GAAG,OAAO,CAAA;IACtB,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,QAAQ,IAAI,YAAY,CAAC,CAAA;QACvF,MAAM,KAAK,GAAG,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACjE,IAAI,KAAK,EAAE,CAAC;YACV,QAAQ,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;QAC/D,CAAC;IACH,CAAC;IAED,iBAAiB;IACjB,OAAO,GAAG,OAAO,CAAC,cAAc,QAAQ,IAAI,IAAI,QAAQ,GAAG,CAAA;AAC7D,CAAC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { BuildingInspection, ProjectType } from './building-inspection'\nimport { NewBuildingInspection, UpdateBuildingInspection, UpdateBuildingInspectionSubmitType } from './building-inspection-type'\nimport { BuildingInspectionStatus } from './building-inspection'\nimport { Checklist, DocumentNoType } from '../checklist/checklist'\nimport { ChecklistItem } from '../checklist-item/checklist-item'\nimport { getRepository } from '@things-factory/shell'\nimport { BuildingLevel } from '@dssp/building-complex'\nimport { config } from '@things-factory/env'\nimport { ChecklistReferenceType } from '../checklist/checklist'\n\nconst projectType = config.get('projectType', ProjectType.DSSP)\n\n@Resolver(BuildingInspection)\nexport class BuildingInspectionMutation {\n @Directive('@transaction')\n @Mutation(returns => BuildingInspection, { description: 'To create Building Inspection information' })\n async createBuildingInspection(\n @Arg('patch') patch: NewBuildingInspection,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspection> {\n const { user, tx } = context.state\n const { buildingLevelId, checklist, checklistItem, cellX, cellY, managerId } = patch\n const buildingInspectionRepository = tx.getRepository(BuildingInspection)\n const checklistRepository = tx.getRepository(Checklist)\n const checklistItemRepository = tx.getRepository(ChecklistItem)\n\n // 1. 벨리데이션\n if (!checklist.constructionType) throw new Error('공종 타입이 없습니다.')\n if (!checklist.constructionDetailType) throw new Error('상세 공종 타입이 없습니다.')\n if (!checklist.name) throw new Error('체크리스트 이름이 없습니다.')\n if (checklistItem.length === 0) throw new Error('체크리스트 아이템이 없습니다.')\n\n if (projectType === ProjectType.DSSP) {\n if (!cellX || !cellY) throw new Error('셀 좌표가 없습니다.')\n if (!managerId) throw new Error('담당자가 없습니다.')\n if (!buildingLevelId) throw new Error('층 아이디가 없습니다.')\n if (!checklist.location) throw new Error('위치가 없습니다.')\n } else if (projectType === ProjectType.DCSP) {\n if (!checklist.inspectionDrawingType) throw new Error('검측 도면 타입이 없습니다.')\n if (checklist.inspectionParts.length === 0) throw new Error('검측 부위가 없습니다.')\n if (!buildingLevelId) throw new Error('층 아이디가 없습니다.')\n if (!checklist.location) throw new Error('위치가 없습니다.')\n }\n\n // 2. checklist 저장\n const checklistDocumentNo = await getRecentDocumentNoByBuildingLevelId(buildingLevelId, DocumentNoType.CHECKLIST, tx)\n const inspectionRequestDocumentNo = checklistDocumentNo.replace(\n `검측 제${DocumentNoType.CHECKLIST}-`,\n `검측 제${DocumentNoType.INSPECTION_REQUEST}-`\n )\n const inspectionResultDocumentNo = checklistDocumentNo.replace(\n `검측 제${DocumentNoType.CHECKLIST}-`,\n `검측 제${DocumentNoType.INSPECTION_RESULT}-`\n )\n\n const savedChecklist = await checklistRepository.save({\n ...checklist,\n projectType,\n checklistReferenceType: ChecklistReferenceType.INSPECTION,\n documentNo: checklistDocumentNo,\n inspectionRequestDocumentNo,\n inspectionResultDocumentNo,\n creator: user,\n updater: user\n })\n\n // 3. checklistItem 저장\n const checklistItems = checklistItem.map((item, idx) => ({\n name: item.name,\n mainType: item.mainType,\n detailType: item.detailType,\n inspctionCriteria: item.inspctionCriteria,\n sequence: idx,\n checklist: savedChecklist,\n creator: user,\n updater: user\n }))\n await checklistItemRepository.save(checklistItems)\n\n // 4. buildingInspection 저장\n const result = await buildingInspectionRepository.save({\n status: BuildingInspectionStatus.WAIT,\n buildingLevel: { id: buildingLevelId },\n checklist: savedChecklist,\n projectType,\n manager: managerId ? { id: managerId } : null,\n cellX,\n cellY,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n // 검측 상태 변경 & 체크리스트 갱신\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To create Building Inspection And Checklist information' })\n async updateBuildingInspectionChecklist(\n @Arg('buildingInspection') buildingInspection: UpdateBuildingInspectionSubmitType,\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { user, tx } = context.state\n const { id: buildingInspectionId, memo, requestDate, checklist, checklistItem } = buildingInspection\n const buildingInspectionRepo = tx.getRepository(BuildingInspection)\n const checklistRepo = tx.getRepository(Checklist)\n const checklistItemRepo = tx.getRepository(ChecklistItem)\n const oldBuildingInspection = await buildingInspectionRepo.findOneBy({ id: buildingInspectionId })\n const status = oldBuildingInspection.status\n const isConstructor: boolean =\n status == BuildingInspectionStatus.WAIT ||\n status == BuildingInspectionStatus.OVERALL_WAIT ||\n status == BuildingInspectionStatus.FAIL\n let inspectionStatus = null\n let signedUserType = null // 싸인을 한 유저 타입\n let inspectionRequestData = {}\n let inspectionResultData = {}\n\n // 1. 벨리데이션\n if (!buildingInspectionId) throw new Error('검측 아이디가 없습니다.')\n if (!status) throw new Error('검측 상태가 없습니다.')\n if (status == BuildingInspectionStatus.PASS) throw new Error('검측 상태가 수정할 수 있는 상태가 아닙니다.')\n\n if (isConstructor) {\n // 시공자 타입별 밸리데이션\n if (checklistItem.length !== checklistItem.filter(v => v.constructionConfirmStatus).length) {\n throw new Error('아이템을 모두 체크해야 합니다.')\n }\n if (status == BuildingInspectionStatus.OVERALL_WAIT && !checklist.overallConstructorSignature) {\n throw new Error('총괄 시공책임자 사인이 없습니다.')\n }\n if (status == BuildingInspectionStatus.WAIT && !checklist.taskConstructorSignature) {\n throw new Error('공종별 시공관리자 사인이 없습니다.')\n }\n\n // 시공자 상태 데이터\n const isPassed = checklistItem.length === checklistItem.filter(v => v.constructionConfirmStatus === 'T').length\n\n if (!isPassed) {\n // 1. 검측이 불햡격 = 상태는 불합격으로, 시공자 싸인은 모두 초기화\n inspectionStatus = BuildingInspectionStatus.FAIL\n checklist.overallConstructorSignature = null\n checklist.taskConstructorSignature = null\n } else if (isPassed && (status === BuildingInspectionStatus.WAIT || status === BuildingInspectionStatus.FAIL)) {\n // 2. 검측이 합격이면서 공종 시공자 스탭 = 상태는 총괄 시공자 스탭으로\n inspectionStatus = BuildingInspectionStatus.OVERALL_WAIT\n signedUserType = 'taskConstructor'\n } else if (isPassed && status === BuildingInspectionStatus.OVERALL_WAIT) {\n // 3. 검측이 합격이면서 총괄 시공자 스탭 = 상태는 공종 감리자 스탭으로, 감리자 싸인은 모두 초기화\n inspectionStatus = BuildingInspectionStatus.REQUEST\n checklist.overallSupervisorySignature = null\n checklist.taskSupervisorySignature = null\n signedUserType = 'overallConstructor'\n inspectionRequestData = {\n inspectionRequestMemo: checklist.inspectionRequestMemo,\n inspectionRequestUpdatedAt: new Date()\n }\n }\n } else {\n // 감리자 타입별 밸리데이션\n if (checklistItem.length !== checklistItem.filter(v => v.supervisoryConfirmStatus).length) {\n throw new Error('아이템을 모두 체크해야 합니다.')\n }\n if (status == BuildingInspectionStatus.OVERALL_REQUEST && !checklist.overallSupervisorySignature) {\n throw new Error('총괄 감리책임자 사인이 없습니다.')\n }\n if (status == BuildingInspectionStatus.REQUEST && !checklist.taskSupervisorySignature) {\n throw new Error('공종별 감리 책임자 사인이 없습니다.')\n }\n\n // 감리자 상태 데이터\n const isPassed = checklistItem.length === checklistItem.filter(v => v.supervisoryConfirmStatus === 'T').length\n if (!isPassed) {\n // 1. 검측이 불햡격 = 상태는 불합격으로, 시공자 싸인은 모두 초기화\n inspectionStatus = BuildingInspectionStatus.FAIL\n checklist.overallConstructorSignature = null\n checklist.taskConstructorSignature = null\n } else if (isPassed && status === BuildingInspectionStatus.REQUEST) {\n // 2. 검측이 합격이면서 공종 감리자 스탭 = 상태는 총괄 감리자 스탭으로\n inspectionStatus = BuildingInspectionStatus.OVERALL_REQUEST\n signedUserType = 'taskSupervisory'\n } else if (isPassed && status === BuildingInspectionStatus.OVERALL_REQUEST) {\n // 3. 검측이 합격이면서 총괄 감리자 스탭 = 상태는 합격으로\n inspectionStatus = BuildingInspectionStatus.PASS\n signedUserType = 'overallSupervisory'\n inspectionResultData = {\n inspectionResultStatus: checklist.inspectionResultStatus,\n inspectionResultMemo: checklist.inspectionResultMemo,\n inspectionResultType: checklist.inspectionResultType,\n inspectionResultUpdatedAt: new Date()\n }\n }\n }\n\n // 2. buildingInspection 저장\n await buildingInspectionRepo.save({\n ...oldBuildingInspection,\n status: inspectionStatus,\n failCount:\n inspectionStatus === BuildingInspectionStatus.FAIL\n ? (oldBuildingInspection.failCount || 0) + 1\n : oldBuildingInspection.failCount || 0,\n ...(requestDate !== undefined && { requestDate }),\n memo: memo,\n updater: user\n })\n\n // 3. checklist 저장\n const oldChecklist = await checklistRepo.findOneBy({ id: checklist.id })\n const inspectionDateField = isConstructor ? 'constructionInspectionDate' : 'supervisorInspectionDate'\n const signedUser = signedUserType ? { [signedUserType]: user } : {}\n\n await checklistRepo.save({\n ...oldChecklist,\n [inspectionDateField]: new Date(),\n overallConstructorSignature: checklist.overallConstructorSignature,\n taskConstructorSignature: checklist.taskConstructorSignature,\n overallSupervisorySignature: checklist.overallSupervisorySignature,\n taskSupervisorySignature: checklist.taskSupervisorySignature,\n ...signedUser,\n ...inspectionRequestData,\n ...inspectionResultData,\n updater: user\n })\n\n // 4. checklistItem 저장\n for (let item of checklistItem) {\n const confirmStatusField = isConstructor ? 'constructionConfirmStatus' : 'supervisoryConfirmStatus'\n const existingItem = await checklistItemRepo.findOneBy({ id: item.id })\n await checklistItemRepo.save({\n ...existingItem,\n [confirmStatusField]: item[confirmStatusField],\n updater: user\n })\n }\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => BuildingInspection, { description: 'To update Building Inspection information' })\n async updateBuildingInspection(\n @Arg('patch') patch: UpdateBuildingInspection,\n @Ctx() context: ResolverContext\n ): Promise<BuildingInspection> {\n const { user, tx } = context.state\n const buildingInspectionRepo = tx.getRepository(BuildingInspection)\n\n // 벨리데이션\n if (!patch.id) throw new Error('검측 아이디가 없습니다.')\n\n const buildingInspection = await buildingInspectionRepo.findOneBy({ id: patch.id })\n\n // 완료 상태인 검측데이터면 삭제 못함\n if (buildingInspection.status === BuildingInspectionStatus.PASS) {\n throw new Error('완료 상태인 검측정보를 변경할 수 없습니다.')\n }\n\n const result = await buildingInspectionRepo.save({\n ...buildingInspection,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Checklists' })\n async deleteBuildingInspections(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { tx } = context.state\n const buildingInspectionRepository = tx.getRepository(BuildingInspection)\n const checklistRepository = tx.getRepository(Checklist)\n const checklistItemRepository = tx.getRepository(ChecklistItem)\n\n const buildingInspections = await buildingInspectionRepository.createQueryBuilder('bi').whereInIds(ids).getMany()\n\n // 완료 상태인 검측데이터가 한개라도 있으면 삭제 못함\n if (buildingInspections.filter(bi => bi.status === BuildingInspectionStatus.PASS).length > 0) {\n throw new Error('완료 상태인 검측정보를 변경할 수 없습니다.')\n }\n\n // 검측 데이터 제거\n await buildingInspectionRepository.softDelete({\n id: In(ids)\n })\n\n // 검측 데이터의 체크 리스트 제거\n const checklistIds = buildingInspections.map(bi => bi.checklistId)\n await checklistRepository.softDelete({\n id: In(checklistIds)\n })\n\n // 검측 데이터의 체크 리스트 아이템 제거\n await checklistItemRepository\n .createQueryBuilder()\n .softDelete()\n .where('checklist_id IN (:...checklistIds)', { checklistIds })\n .execute()\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To apply to all building inspection' })\n async applyToAllBuildingInspection(\n @Arg('buildingInspectionId') buildingInspectionId: string,\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { user, tx } = context.state\n const buildingInspectionRepository = tx.getRepository(BuildingInspection)\n\n const buildingInspection = await buildingInspectionRepository.findOne({\n where: { id: buildingInspectionId },\n relations: ['buildingLevel', 'buildingLevel.building', 'checklist', 'checklist.checklistItems']\n })\n\n const checklist = buildingInspection.checklist\n const checklistItems = checklist.checklistItems\n const buildingLevels = await getRepository(BuildingLevel).find({\n where: { building: { id: buildingInspection.buildingLevel.building.id } }\n })\n\n // 해당 검측 정보가 속한 동의 모든 층에 같은 검측 데이터 등록\n for (let buildingLevel of buildingLevels) {\n // 같은 셀에 이미 검측 정보가 있으면 패스\n const existInspection = await buildingInspectionRepository.findOneBy({\n buildingLevel: { id: buildingLevel.id },\n cellX: buildingInspection.cellX,\n cellY: buildingInspection.cellY\n })\n if (existInspection) continue\n\n // 새로운 체크리스트 데이터\n const newChecklist = {\n name: checklist.name,\n location: `${buildingInspection.buildingLevel.building.name} ${buildingLevel.floor}층`,\n constructionType: checklist.constructionType,\n constructionDetailType: checklist.constructionDetailType,\n inspectionDrawingType: checklist.inspectionDrawingType,\n inspectionParts: checklist.inspectionParts\n }\n\n // 새로운 체크리스트 아이템 데이터\n const newChecklistItems = checklistItems.map(item => ({\n name: item.name,\n mainType: item.mainType,\n detailType: item.detailType,\n inspctionCriteria: item.inspctionCriteria\n }))\n\n await this.createBuildingInspection(\n {\n buildingLevelId: buildingLevel.id,\n checklist: newChecklist,\n checklistItem: newChecklistItems,\n cellX: buildingInspection.cellX,\n cellY: buildingInspection.cellY,\n managerId: buildingInspection.managerId\n },\n context\n )\n }\n\n return true\n }\n}\n\nasync function getRecentDocumentNoByBuildingLevelId(buildingLevelId: string, type: DocumentNoType, tx: any): Promise<string> {\n const project = await tx\n .createQueryBuilder()\n .select('p.documentNaming', 'documentNaming')\n .addSelect('bc.id', 'buildingComplexId')\n .from('projects', 'p')\n .innerJoin('building_complexes', 'bc', 'bc.id = p.building_complex_id')\n .innerJoin('buildings', 'b', 'b.building_complex_id = bc.id')\n .innerJoin('building_levels', 'bl', 'bl.building_id = b.id')\n .where('bl.id = :buildingLevelId', { buildingLevelId })\n .getRawOne()\n\n const latestChecklist = await tx\n .getRepository(Checklist)\n .createQueryBuilder('c')\n .innerJoin('c.buildingInspection', 'bi')\n .innerJoin('bi.buildingLevel', 'bl')\n .innerJoin('bl.building', 'b')\n .where('b.building_complex_id = :buildingComplexId', { buildingComplexId: project.buildingComplexId })\n .andWhere('c.document_no LIKE :pattern', { pattern: `${project.documentNaming} 검측 제${type}-%` })\n .orderBy('c.created_at', 'DESC')\n .getOne()\n\n // 4. 시퀀스 번호 생성 (5자리)\n let sequence = '00001'\n if (latestChecklist) {\n const documentNoPattern = new RegExp(`${project.documentNaming} 검측 제${type}-(\\\\d{5})호`)\n const match = latestChecklist.documentNo.match(documentNoPattern)\n if (match) {\n sequence = (Number(match[1]) + 1).toString().padStart(5, '0')\n }\n }\n\n // 5. 최종 문서 번호 생성\n return `${project.documentNaming} 검측 제${type}-${sequence}호`\n}\n"]}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { Attachment } from '@things-factory/attachment-base';
|
|
2
2
|
import { ListParam } from '@things-factory/shell';
|
|
3
3
|
import { BuildingInspection } from './building-inspection';
|
|
4
|
-
import { BuildingInspectionList, BuildingInspectionsOfBuildingLevel, BuildingInspectionsOfProject, BuildingInspectionSummary } from './building-inspection-type';
|
|
4
|
+
import { BuildingInspectionList, BuildingInspectionsOfBuildingLevel, BuildingInspectionsOfProject, BuildingInspectionSummary, ProjectManagerOutput } from './building-inspection-type';
|
|
5
5
|
import { BuildingLevel } from '@dssp/building-complex';
|
|
6
6
|
import { Checklist } from '../checklist/checklist';
|
|
7
|
-
import { Project, ManagerOutput } from '@dssp/project';
|
|
8
7
|
export declare class BuildingInspectionQuery {
|
|
9
8
|
buildingInspection(id: string, context: ResolverContext): Promise<BuildingInspection>;
|
|
10
|
-
buildingInspections(params: ListParam
|
|
9
|
+
buildingInspections(params: ListParam): Promise<BuildingInspectionList>;
|
|
11
10
|
buildingInspectionsOfProject(params: BuildingInspectionsOfProject, context: ResolverContext): Promise<BuildingInspectionList>;
|
|
12
|
-
projectByBuildingLevelId(buildingLevelId: string, context: ResolverContext): Promise<Project>;
|
|
13
11
|
buildingInspectionsOfBuildingLevel(params: BuildingInspectionsOfBuildingLevel, context: ResolverContext): Promise<BuildingInspectionList>;
|
|
14
12
|
buildingInspectionSummaryOfBuildingLevel(buildingLevelId: string, context: ResolverContext): Promise<BuildingInspectionSummary>;
|
|
15
13
|
buildingInspectionDateSummaryOfLevelAndPeriod(buildingLevelId: string, startDate: string, endDate: string, context: ResolverContext): Promise<BuildingInspectionSummary[]>;
|
|
16
14
|
buildingInspectionSummary(buildingLevel: BuildingLevel): Promise<BuildingInspectionSummary>;
|
|
17
|
-
buildingInspectionSummaryOfProject(projectId: string
|
|
15
|
+
buildingInspectionSummaryOfProject(projectId: string): Promise<BuildingInspectionSummary>;
|
|
18
16
|
checklist(buildingInspection: BuildingInspection): Promise<Checklist>;
|
|
19
17
|
buildingLevel(buildingInspection: BuildingInspection): Promise<BuildingLevel>;
|
|
20
|
-
|
|
21
|
-
manager(buildingInspection: BuildingInspection): Promise<
|
|
18
|
+
attachments(buildingInspection: BuildingInspection): Promise<Attachment[] | undefined>;
|
|
19
|
+
manager(buildingInspection: BuildingInspection): Promise<ProjectManagerOutput>;
|
|
22
20
|
}
|