@dssp/project 1.0.0 → 1.0.2
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/bootstrap.d.ts +0 -0
- package/dist-client/bootstrap.js +2 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/index.d.ts +1 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/pages/lib/chatbot-widget.d.ts +53 -0
- package/dist-client/pages/lib/chatbot-widget.js +631 -0
- package/dist-client/pages/lib/chatbot-widget.js.map +1 -0
- package/dist-client/pages/lib/select2-component.d.ts +23 -0
- package/dist-client/pages/lib/select2-component.js +181 -0
- package/dist-client/pages/lib/select2-component.js.map +1 -0
- package/dist-client/pages/lib/waether.d.ts +7 -0
- package/dist-client/pages/lib/waether.js +156 -0
- package/dist-client/pages/lib/waether.js.map +1 -0
- package/dist-client/pages/project/component/pagenation.d.ts +18 -0
- package/dist-client/pages/project/component/pagenation.js +142 -0
- package/dist-client/pages/project/component/pagenation.js.map +1 -0
- package/dist-client/pages/project/component/project-update-header.d.ts +1 -0
- package/dist-client/pages/project/component/project-update-header.js +121 -0
- package/dist-client/pages/project/component/project-update-header.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.d.ts +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js +308 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.d.ts +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js +356 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.d.ts +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js +682 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js.map +1 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-view.d.ts +33 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-view.js +676 -0
- package/dist-client/pages/project/popup/checklist/task-checklist-view.js.map +1 -0
- package/dist-client/pages/project/popup/popup-plan-export.d.ts +10 -0
- package/dist-client/pages/project/popup/popup-plan-export.js +242 -0
- package/dist-client/pages/project/popup/popup-plan-export.js.map +1 -0
- package/dist-client/pages/project/popup/popup-plan-upload.d.ts +13 -0
- package/dist-client/pages/project/popup/popup-plan-upload.js +265 -0
- package/dist-client/pages/project/popup/popup-plan-upload.js.map +1 -0
- package/dist-client/pages/project/popup/popup-project-create.d.ts +12 -0
- package/dist-client/pages/project/popup/popup-project-create.js +152 -0
- package/dist-client/pages/project/popup/popup-project-create.js.map +1 -0
- package/dist-client/pages/project/popup/popup-task-upload.d.ts +9 -0
- package/dist-client/pages/project/popup/popup-task-upload.js +105 -0
- package/dist-client/pages/project/popup/popup-task-upload.js.map +1 -0
- package/dist-client/pages/project/project-completed-list.d.ts +23 -0
- package/dist-client/pages/project/project-completed-list.js +322 -0
- package/dist-client/pages/project/project-completed-list.js.map +1 -0
- package/dist-client/pages/project/project-detail.d.ts +47 -0
- package/dist-client/pages/project/project-detail.js +1065 -0
- package/dist-client/pages/project/project-detail.js.map +1 -0
- package/dist-client/pages/project/project-list.d.ts +201 -0
- package/dist-client/pages/project/project-list.js +410 -0
- package/dist-client/pages/project/project-list.js.map +1 -0
- package/dist-client/pages/project/project-plan-management.d.ts +33 -0
- package/dist-client/pages/project/project-plan-management.js +492 -0
- package/dist-client/pages/project/project-plan-management.js.map +1 -0
- package/dist-client/pages/project/project-setting-list.d.ts +31 -0
- package/dist-client/pages/project/project-setting-list.js +456 -0
- package/dist-client/pages/project/project-setting-list.js.map +1 -0
- package/dist-client/pages/project/project-task-list.d.ts +18 -0
- package/dist-client/pages/project/project-task-list.js +306 -0
- package/dist-client/pages/project/project-task-list.js.map +1 -0
- package/dist-client/pages/project/project-task.d.ts +51 -0
- package/dist-client/pages/project/project-task.js +692 -0
- package/dist-client/pages/project/project-task.js.map +1 -0
- package/dist-client/pages/project/project-update.d.ts +81 -0
- package/dist-client/pages/project/project-update.js +1477 -0
- package/dist-client/pages/project/project-update.js.map +1 -0
- package/dist-client/pages/resource/construction-detail-type-popup.d.ts +2 -0
- package/dist-client/pages/resource/construction-detail-type-popup.js +197 -0
- package/dist-client/pages/resource/construction-detail-type-popup.js.map +1 -0
- package/dist-client/pages/resource/construction-type-management.d.ts +34 -0
- package/dist-client/pages/resource/construction-type-management.js +214 -0
- package/dist-client/pages/resource/construction-type-management.js.map +1 -0
- package/dist-client/pages/resource/inspection-drawing-type-management.d.ts +48 -0
- package/dist-client/pages/resource/inspection-drawing-type-management.js +234 -0
- package/dist-client/pages/resource/inspection-drawing-type-management.js.map +1 -0
- package/dist-client/pages/resource/inspection-part-popup.d.ts +2 -0
- package/dist-client/pages/resource/inspection-part-popup.js +197 -0
- package/dist-client/pages/resource/inspection-part-popup.js.map +1 -0
- package/dist-client/pages/resource/resource-importer.d.ts +10 -0
- package/dist-client/pages/resource/resource-importer.js +101 -0
- package/dist-client/pages/resource/resource-importer.js.map +1 -0
- package/dist-client/pages/resource/resource-list-page.d.ts +62 -0
- package/dist-client/pages/resource/resource-list-page.js +331 -0
- package/dist-client/pages/resource/resource-list-page.js.map +1 -0
- package/dist-client/pages/resource/worker-type-management.d.ts +34 -0
- package/dist-client/pages/resource/worker-type-management.js +180 -0
- package/dist-client/pages/resource/worker-type-management.js.map +1 -0
- package/dist-client/pages/task/task-importer.d.ts +10 -0
- package/dist-client/pages/task/task-importer.js +101 -0
- package/dist-client/pages/task/task-importer.js.map +1 -0
- package/dist-client/pages/task/task-list-page.d.ts +62 -0
- package/dist-client/pages/task/task-list-page.js +322 -0
- package/dist-client/pages/task/task-list-page.js.map +1 -0
- package/dist-client/pages/task-resource/task-resource-importer.d.ts +10 -0
- package/dist-client/pages/task-resource/task-resource-importer.js +101 -0
- package/dist-client/pages/task-resource/task-resource-importer.js.map +1 -0
- package/dist-client/pages/task-resource/task-resource-list-page.d.ts +62 -0
- package/dist-client/pages/task-resource/task-resource-list-page.js +331 -0
- package/dist-client/pages/task-resource/task-resource-list-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +44 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/shared/domain-context.d.ts +18 -0
- package/dist-client/shared/domain-context.js +28 -0
- package/dist-client/shared/domain-context.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-client/viewparts/domain-switch.d.ts +19 -0
- package/dist-client/viewparts/domain-switch.js +274 -0
- package/dist-client/viewparts/domain-switch.js.map +1 -0
- package/dist-server/controllers/export-tasks.d.ts +7 -0
- package/dist-server/controllers/export-tasks.js +29 -0
- package/dist-server/controllers/export-tasks.js.map +1 -0
- package/dist-server/controllers/import-task.d.ts +3 -0
- package/dist-server/controllers/import-task.js +113 -0
- package/dist-server/controllers/import-task.js.map +1 -0
- package/dist-server/controllers/index.d.ts +0 -0
- package/dist-server/controllers/index.js +1 -0
- package/dist-server/controllers/index.js.map +1 -0
- package/dist-server/controllers/parse-excel.d.ts +2 -0
- package/dist-server/controllers/parse-excel.js +74 -0
- package/dist-server/controllers/parse-excel.js.map +1 -0
- package/dist-server/controllers/types.d.ts +18 -0
- package/dist-server/controllers/types.js +3 -0
- package/dist-server/controllers/types.js.map +1 -0
- package/dist-server/index.d.ts +3 -0
- package/dist-server/index.js +7 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/middlewares/index.d.ts +1 -0
- package/dist-server/middlewares/index.js +7 -0
- package/dist-server/middlewares/index.js.map +1 -0
- package/dist-server/migrations/1723861466413-seed-roles.d.ts +5 -0
- package/dist-server/migrations/1723861466413-seed-roles.js +117 -0
- package/dist-server/migrations/1723861466413-seed-roles.js.map +1 -0
- package/dist-server/migrations/1723861466414-seed-codes.d.ts +5 -0
- package/dist-server/migrations/1723861466414-seed-codes.js +150 -0
- package/dist-server/migrations/1723861466414-seed-codes.js.map +1 -0
- package/dist-server/migrations/1723861476419-seed-resources.d.ts +5 -0
- package/dist-server/migrations/1723861476419-seed-resources.js +57 -0
- package/dist-server/migrations/1723861476419-seed-resources.js.map +1 -0
- package/dist-server/migrations/1723861478420-seed-/bsample-project.d.ts +5 -0
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js +68 -0
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +1 -0
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.d.ts +5 -0
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js +189 -0
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +1 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/migrations/index.js +12 -0
- package/dist-server/migrations/index.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +105 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.d.ts +6 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +56 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-query.d.ts +9 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js +53 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-type.d.ts +11 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js +43 -0
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +1 -0
- package/dist-server/service/construction-detail-type/construction-detail-type.d.ts +15 -0
- package/dist-server/service/construction-detail-type/construction-detail-type.js +69 -0
- package/dist-server/service/construction-detail-type/construction-detail-type.js.map +1 -0
- package/dist-server/service/construction-detail-type/index.d.ts +5 -0
- package/dist-server/service/construction-detail-type/index.js +9 -0
- package/dist-server/service/construction-detail-type/index.js.map +1 -0
- package/dist-server/service/construction-type/construction-type-mutation.d.ts +6 -0
- package/dist-server/service/construction-type/construction-type-mutation.js +64 -0
- package/dist-server/service/construction-type/construction-type-mutation.js.map +1 -0
- package/dist-server/service/construction-type/construction-type-query.d.ts +13 -0
- package/dist-server/service/construction-type/construction-type-query.js +87 -0
- package/dist-server/service/construction-type/construction-type-query.js.map +1 -0
- package/dist-server/service/construction-type/construction-type-type.d.ts +12 -0
- package/dist-server/service/construction-type/construction-type-type.js +47 -0
- package/dist-server/service/construction-type/construction-type-type.js.map +1 -0
- package/dist-server/service/construction-type/construction-type.d.ts +19 -0
- package/dist-server/service/construction-type/construction-type.js +88 -0
- package/dist-server/service/construction-type/construction-type.js.map +1 -0
- package/dist-server/service/construction-type/index.d.ts +5 -0
- package/dist-server/service/construction-type/index.js +9 -0
- package/dist-server/service/construction-type/index.js.map +1 -0
- package/dist-server/service/index.d.ts +15 -0
- package/dist-server/service/index.js +59 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/index.d.ts +5 -0
- package/dist-server/service/inspection-drawing-type/index.js +9 -0
- package/dist-server/service/inspection-drawing-type/index.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.d.ts +6 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +64 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +12 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +78 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.d.ts +10 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +39 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +1 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.d.ts +16 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +72 -0
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +1 -0
- package/dist-server/service/inspection-part/index.d.ts +5 -0
- package/dist-server/service/inspection-part/index.js +9 -0
- package/dist-server/service/inspection-part/index.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part-mutation.d.ts +6 -0
- package/dist-server/service/inspection-part/inspection-part-mutation.js +55 -0
- package/dist-server/service/inspection-part/inspection-part-mutation.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part-query.d.ts +10 -0
- package/dist-server/service/inspection-part/inspection-part-query.js +66 -0
- package/dist-server/service/inspection-part/inspection-part-query.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part-type.d.ts +11 -0
- package/dist-server/service/inspection-part/inspection-part-type.js +43 -0
- package/dist-server/service/inspection-part/inspection-part-type.js.map +1 -0
- package/dist-server/service/inspection-part/inspection-part.d.ts +15 -0
- package/dist-server/service/inspection-part/inspection-part.js +69 -0
- package/dist-server/service/inspection-part/inspection-part.js.map +1 -0
- package/dist-server/service/manager/index.d.ts +7 -0
- package/dist-server/service/manager/index.js +11 -0
- package/dist-server/service/manager/index.js.map +1 -0
- package/dist-server/service/manager/manager-mutation.d.ts +5 -0
- package/dist-server/service/manager/manager-mutation.js +39 -0
- package/dist-server/service/manager/manager-mutation.js.map +1 -0
- package/dist-server/service/manager/manager-query.d.ts +4 -0
- package/dist-server/service/manager/manager-query.js +35 -0
- package/dist-server/service/manager/manager-query.js.map +1 -0
- package/dist-server/service/manager/manager-type.d.ts +15 -0
- package/dist-server/service/manager/manager-type.js +62 -0
- package/dist-server/service/manager/manager-type.js.map +1 -0
- package/dist-server/service/manager/manager.d.ts +8 -0
- package/dist-server/service/manager/manager.js +41 -0
- package/dist-server/service/manager/manager.js.map +1 -0
- package/dist-server/service/project/index.d.ts +5 -0
- package/dist-server/service/project/index.js +9 -0
- package/dist-server/service/project/index.js.map +1 -0
- package/dist-server/service/project/issue-project-code.d.ts +7 -0
- package/dist-server/service/project/issue-project-code.js +27 -0
- package/dist-server/service/project/issue-project-code.js.map +1 -0
- package/dist-server/service/project/project-mutation.d.ts +28 -0
- package/dist-server/service/project/project-mutation.js +499 -0
- package/dist-server/service/project/project-mutation.js.map +1 -0
- package/dist-server/service/project/project-query.d.ts +31 -0
- package/dist-server/service/project/project-query.js +307 -0
- package/dist-server/service/project/project-query.js.map +1 -0
- package/dist-server/service/project/project-type.d.ts +42 -0
- package/dist-server/service/project/project-type.js +152 -0
- package/dist-server/service/project/project-type.js.map +1 -0
- package/dist-server/service/project/project.d.ts +66 -0
- package/dist-server/service/project/project.js +247 -0
- package/dist-server/service/project/project.js.map +1 -0
- package/dist-server/service/resource/index.d.ts +6 -0
- package/dist-server/service/resource/index.js +10 -0
- package/dist-server/service/resource/index.js.map +1 -0
- package/dist-server/service/resource/resource-mutation.d.ts +10 -0
- package/dist-server/service/resource/resource-mutation.js +131 -0
- package/dist-server/service/resource/resource-mutation.js.map +1 -0
- package/dist-server/service/resource/resource-query.d.ts +11 -0
- package/dist-server/service/resource/resource-query.js +76 -0
- package/dist-server/service/resource/resource-query.js.map +1 -0
- package/dist-server/service/resource/resource-type.d.ts +17 -0
- package/dist-server/service/resource/resource-type.js +65 -0
- package/dist-server/service/resource/resource-type.js.map +1 -0
- package/dist-server/service/resource/resource.d.ts +24 -0
- package/dist-server/service/resource/resource.js +93 -0
- package/dist-server/service/resource/resource.js.map +1 -0
- package/dist-server/service/task/index.d.ts +5 -0
- package/dist-server/service/task/index.js +9 -0
- package/dist-server/service/task/index.js.map +1 -0
- package/dist-server/service/task/task-mutation.d.ts +10 -0
- package/dist-server/service/task/task-mutation.js +135 -0
- package/dist-server/service/task/task-mutation.js.map +1 -0
- package/dist-server/service/task/task-query.d.ts +21 -0
- package/dist-server/service/task/task-query.js +219 -0
- package/dist-server/service/task/task-query.js.map +1 -0
- package/dist-server/service/task/task-type.d.ts +31 -0
- package/dist-server/service/task/task-type.js +114 -0
- package/dist-server/service/task/task-type.js.map +1 -0
- package/dist-server/service/task/task.d.ts +35 -0
- package/dist-server/service/task/task.js +151 -0
- package/dist-server/service/task/task.js.map +1 -0
- package/dist-server/service/task-checklist-binding/index.d.ts +5 -0
- package/dist-server/service/task-checklist-binding/index.js +9 -0
- package/dist-server/service/task-checklist-binding/index.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.d.ts +5 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js +188 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.d.ts +8 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js +61 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.d.ts +15 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js +57 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js.map +1 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding.d.ts +22 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding.js +106 -0
- package/dist-server/service/task-checklist-binding/task-checklist-binding.js.map +1 -0
- package/dist-server/service/task-resource/index.d.ts +6 -0
- package/dist-server/service/task-resource/index.js +10 -0
- package/dist-server/service/task-resource/index.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-mutation.d.ts +10 -0
- package/dist-server/service/task-resource/task-resource-mutation.js +132 -0
- package/dist-server/service/task-resource/task-resource-mutation.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-query.d.ts +7 -0
- package/dist-server/service/task-resource/task-resource-query.js +45 -0
- package/dist-server/service/task-resource/task-resource-query.js.map +1 -0
- package/dist-server/service/task-resource/task-resource-type.d.ts +17 -0
- package/dist-server/service/task-resource/task-resource-type.js +65 -0
- package/dist-server/service/task-resource/task-resource-type.js.map +1 -0
- package/dist-server/service/task-resource/task-resource.d.ts +13 -0
- package/dist-server/service/task-resource/task-resource.js +59 -0
- package/dist-server/service/task-resource/task-resource.js.map +1 -0
- package/dist-server/service/worker-type/index.d.ts +5 -0
- package/dist-server/service/worker-type/index.js +9 -0
- package/dist-server/service/worker-type/index.js.map +1 -0
- package/dist-server/service/worker-type/worker-type-mutation.d.ts +6 -0
- package/dist-server/service/worker-type/worker-type-mutation.js +64 -0
- package/dist-server/service/worker-type/worker-type-mutation.js.map +1 -0
- package/dist-server/service/worker-type/worker-type-query.d.ts +11 -0
- package/dist-server/service/worker-type/worker-type-query.js +73 -0
- package/dist-server/service/worker-type/worker-type-query.js.map +1 -0
- package/dist-server/service/worker-type/worker-type-type.d.ts +11 -0
- package/dist-server/service/worker-type/worker-type-type.js +43 -0
- package/dist-server/service/worker-type/worker-type-type.js.map +1 -0
- package/dist-server/service/worker-type/worker-type.d.ts +16 -0
- package/dist-server/service/worker-type/worker-type.js +77 -0
- package/dist-server/service/worker-type/worker-type.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceList = exports.ResourcePatch = exports.NewResource = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const resource_1 = require("./resource");
|
|
7
|
+
let NewResource = class NewResource {
|
|
8
|
+
};
|
|
9
|
+
exports.NewResource = NewResource;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, type_graphql_1.Field)(),
|
|
12
|
+
tslib_1.__metadata("design:type", String)
|
|
13
|
+
], NewResource.prototype, "name", void 0);
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, type_graphql_1.Field)(type => resource_1.ResourceType),
|
|
16
|
+
tslib_1.__metadata("design:type", String)
|
|
17
|
+
], NewResource.prototype, "type", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, type_graphql_1.Field)(),
|
|
20
|
+
tslib_1.__metadata("design:type", String)
|
|
21
|
+
], NewResource.prototype, "unit", void 0);
|
|
22
|
+
exports.NewResource = NewResource = tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.InputType)()
|
|
24
|
+
], NewResource);
|
|
25
|
+
let ResourcePatch = class ResourcePatch {
|
|
26
|
+
};
|
|
27
|
+
exports.ResourcePatch = ResourcePatch;
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], ResourcePatch.prototype, "id", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], ResourcePatch.prototype, "name", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, type_graphql_1.Field)(type => resource_1.ResourceType, { nullable: true }),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], ResourcePatch.prototype, "type", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], ResourcePatch.prototype, "unit", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
+
tslib_1.__metadata("design:type", String)
|
|
47
|
+
], ResourcePatch.prototype, "cuFlag", void 0);
|
|
48
|
+
exports.ResourcePatch = ResourcePatch = tslib_1.__decorate([
|
|
49
|
+
(0, type_graphql_1.InputType)()
|
|
50
|
+
], ResourcePatch);
|
|
51
|
+
let ResourceList = class ResourceList {
|
|
52
|
+
};
|
|
53
|
+
exports.ResourceList = ResourceList;
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, type_graphql_1.Field)(type => [resource_1.Resource]),
|
|
56
|
+
tslib_1.__metadata("design:type", Array)
|
|
57
|
+
], ResourceList.prototype, "items", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
60
|
+
tslib_1.__metadata("design:type", Number)
|
|
61
|
+
], ResourceList.prototype, "total", void 0);
|
|
62
|
+
exports.ResourceList = ResourceList = tslib_1.__decorate([
|
|
63
|
+
(0, type_graphql_1.ObjectType)()
|
|
64
|
+
], ResourceList);
|
|
65
|
+
//# sourceMappingURL=resource-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-type.js","sourceRoot":"","sources":["../../../server/service/resource/resource-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,yCAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAW;CASvB,CAAA;AATY,kCAAW;AAEtB;IADC,IAAA,oBAAK,GAAE;;yCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,CAAC;;yCACV;AAGlB;IADC,IAAA,oBAAK,GAAE;;yCACI;sBARD,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CASvB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,uBAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC7B;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;wBAdJ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAezB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,mBAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import { InputType, Field, ID, ObjectType, Int } from 'type-graphql'\nimport { Resource, ResourceType } from './resource'\n\n@InputType()\nexport class NewResource {\n @Field()\n name: string\n\n @Field(type => ResourceType)\n type: ResourceType\n\n @Field()\n unit: string\n}\n\n@InputType()\nexport class ResourcePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => ResourceType, { nullable: true })\n type?: ResourceType\n\n @Field({ nullable: true })\n unit?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ResourceList {\n @Field(type => [Resource])\n items: Resource[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { TaskResource } from '../task-resource/task-resource';
|
|
4
|
+
export declare enum ResourceType {
|
|
5
|
+
HUMAN = "HUMAN",
|
|
6
|
+
MATERIAL = "MATERIAL",
|
|
7
|
+
EQUIPMENT = "EQUIPMENT"
|
|
8
|
+
}
|
|
9
|
+
export declare class Resource {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
domain?: Domain;
|
|
12
|
+
domainId?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
type: ResourceType;
|
|
15
|
+
unit: string;
|
|
16
|
+
createdAt?: Date;
|
|
17
|
+
updatedAt?: Date;
|
|
18
|
+
deletedAt?: Date;
|
|
19
|
+
creator?: User;
|
|
20
|
+
creatorId?: string;
|
|
21
|
+
updater?: User;
|
|
22
|
+
updaterId?: string;
|
|
23
|
+
taskResources?: TaskResource[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Resource = exports.ResourceType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const type_graphql_1 = require("type-graphql");
|
|
7
|
+
const shell_1 = require("@things-factory/shell");
|
|
8
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
9
|
+
const task_resource_1 = require("../task-resource/task-resource");
|
|
10
|
+
var ResourceType;
|
|
11
|
+
(function (ResourceType) {
|
|
12
|
+
ResourceType["HUMAN"] = "HUMAN";
|
|
13
|
+
ResourceType["MATERIAL"] = "MATERIAL";
|
|
14
|
+
ResourceType["EQUIPMENT"] = "EQUIPMENT";
|
|
15
|
+
})(ResourceType || (exports.ResourceType = ResourceType = {}));
|
|
16
|
+
(0, type_graphql_1.registerEnumType)(ResourceType, {
|
|
17
|
+
name: 'ResourceType',
|
|
18
|
+
description: '자원 유형'
|
|
19
|
+
});
|
|
20
|
+
let Resource = class Resource {
|
|
21
|
+
};
|
|
22
|
+
exports.Resource = Resource;
|
|
23
|
+
tslib_1.__decorate([
|
|
24
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
25
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], Resource.prototype, "id", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
30
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
31
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
32
|
+
], Resource.prototype, "domain", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.RelationId)((resource) => resource.domain),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], Resource.prototype, "domainId", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ nullable: false, comment: '자원 이름' }),
|
|
39
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], Resource.prototype, "name", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ nullable: false, default: ResourceType.HUMAN, comment: '자원 유형' }),
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
45
|
+
tslib_1.__metadata("design:type", String)
|
|
46
|
+
], Resource.prototype, "type", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ nullable: false, comment: '단위 (예: man/day, kg, hour 등)' }),
|
|
49
|
+
(0, type_graphql_1.Field)({ nullable: false }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], Resource.prototype, "unit", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
54
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
55
|
+
tslib_1.__metadata("design:type", Date)
|
|
56
|
+
], Resource.prototype, "createdAt", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
59
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
60
|
+
tslib_1.__metadata("design:type", Date)
|
|
61
|
+
], Resource.prototype, "updatedAt", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
64
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
|
65
|
+
tslib_1.__metadata("design:type", Date)
|
|
66
|
+
], Resource.prototype, "deletedAt", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
69
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
70
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
71
|
+
], Resource.prototype, "creator", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, typeorm_1.RelationId)((resource) => resource.creator),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], Resource.prototype, "creatorId", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
78
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
79
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
80
|
+
], Resource.prototype, "updater", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.RelationId)((resource) => resource.updater),
|
|
83
|
+
tslib_1.__metadata("design:type", String)
|
|
84
|
+
], Resource.prototype, "updaterId", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
(0, typeorm_1.OneToMany)(() => task_resource_1.TaskResource, taskResource => taskResource.resource),
|
|
87
|
+
tslib_1.__metadata("design:type", Array)
|
|
88
|
+
], Resource.prototype, "taskResources", void 0);
|
|
89
|
+
exports.Resource = Resource = tslib_1.__decorate([
|
|
90
|
+
(0, typeorm_1.Entity)(),
|
|
91
|
+
(0, type_graphql_1.ObjectType)({ description: '자원' })
|
|
92
|
+
], Resource);
|
|
93
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","s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;IAFpB,IAAA,gBAAM,GAAE;IACR,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;GACrB,QAAQ,CAoDpB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Column,\n PrimaryGeneratedColumn,\n ManyToOne,\n RelationId,\n OneToMany\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { TaskResource } from '../task-resource/task-resource'\n\nexport enum ResourceType {\n HUMAN = 'HUMAN',\n MATERIAL = 'MATERIAL',\n EQUIPMENT = 'EQUIPMENT'\n}\n\nregisterEnumType(ResourceType, {\n name: 'ResourceType',\n description: '자원 유형'\n})\n\n@Entity()\n@ObjectType({ description: '자원' })\nexport class Resource {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain?: Domain\n\n @RelationId((resource: Resource) => resource.domain)\n domainId?: string\n\n @Column({ nullable: false, comment: '자원 이름' })\n @Field({ nullable: false })\n name?: string\n\n @Column({ nullable: false, default: ResourceType.HUMAN, comment: '자원 유형' })\n @Field({ nullable: false })\n type: ResourceType\n\n @Column({ nullable: false, comment: '단위 (예: man/day, kg, hour 등)' })\n @Field({ nullable: false })\n unit: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((resource: Resource) => resource.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((resource: Resource) => resource.updater)\n updaterId?: string\n\n @OneToMany(() => TaskResource, taskResource => taskResource.resource)\n taskResources?: TaskResource[]\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const task_1 = require("./task");
|
|
5
|
+
const task_query_1 = require("./task-query");
|
|
6
|
+
const task_mutation_1 = require("./task-mutation");
|
|
7
|
+
exports.entities = [task_1.Task];
|
|
8
|
+
exports.resolvers = [task_query_1.TaskQuery, task_mutation_1.TaskMutation];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/task/index.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,6CAAwC;AACxC,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,WAAI,CAAC,CAAA;AACjB,QAAA,SAAS,GAAG,CAAC,sBAAS,EAAE,4BAAY,CAAC,CAAA","sourcesContent":["import { Task } from './task'\nimport { TaskQuery } from './task-query'\nimport { TaskMutation } from './task-mutation'\n\nexport const entities = [Task]\nexport const resolvers = [TaskQuery, TaskMutation]\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Task } from './task';
|
|
2
|
+
import { NewTask, TaskPatch } from './task-type';
|
|
3
|
+
export declare class TaskMutation {
|
|
4
|
+
createTask(task: NewTask, context: ResolverContext): Promise<Task>;
|
|
5
|
+
updateTask(id: string, patch: TaskPatch, context: ResolverContext): Promise<Task>;
|
|
6
|
+
updateMultipleTask(patches: TaskPatch[], context: ResolverContext): Promise<Task[]>;
|
|
7
|
+
deleteTask(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteTasks(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
importTasks(tasks: TaskPatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const attachment_base_1 = require("@things-factory/attachment-base");
|
|
8
|
+
const task_1 = require("./task");
|
|
9
|
+
const task_type_1 = require("./task-type");
|
|
10
|
+
let TaskMutation = class TaskMutation {
|
|
11
|
+
async createTask(task, context) {
|
|
12
|
+
const { domain, user, tx } = context.state;
|
|
13
|
+
const result = await tx.getRepository(task_1.Task).save(Object.assign(Object.assign({}, task), { domain, creator: user, updater: user }));
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
async updateTask(id, patch, context) {
|
|
17
|
+
const { domain, user, tx } = context.state;
|
|
18
|
+
const repository = tx.getRepository(task_1.Task);
|
|
19
|
+
const task = await repository.findOne({
|
|
20
|
+
where: { id }
|
|
21
|
+
});
|
|
22
|
+
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, task), patch), { updater: user }));
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
async updateMultipleTask(patches, context) {
|
|
26
|
+
const { domain, user, tx } = context.state;
|
|
27
|
+
let results = [];
|
|
28
|
+
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
29
|
+
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
30
|
+
const taskRepo = tx.getRepository(task_1.Task);
|
|
31
|
+
if (_createRecords.length > 0) {
|
|
32
|
+
for (let i = 0; i < _createRecords.length; i++) {
|
|
33
|
+
const newRecord = _createRecords[i];
|
|
34
|
+
const result = await taskRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
35
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (_updateRecords.length > 0) {
|
|
39
|
+
for (let i = 0; i < _updateRecords.length; i++) {
|
|
40
|
+
const updateRecord = _updateRecords[i];
|
|
41
|
+
const task = await taskRepo.findOneBy({ id: updateRecord.id });
|
|
42
|
+
const result = await taskRepo.save(Object.assign(Object.assign(Object.assign({}, task), updateRecord), { updater: user }));
|
|
43
|
+
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return results;
|
|
47
|
+
}
|
|
48
|
+
async deleteTask(id, context) {
|
|
49
|
+
const { domain, tx } = context.state;
|
|
50
|
+
await tx.getRepository(task_1.Task).delete({ id });
|
|
51
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: [id] }, context);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
async deleteTasks(ids, context) {
|
|
55
|
+
const { domain, tx } = context.state;
|
|
56
|
+
await tx.getRepository(task_1.Task).delete({
|
|
57
|
+
id: (0, typeorm_1.In)(ids)
|
|
58
|
+
});
|
|
59
|
+
await (0, attachment_base_1.deleteAttachmentsByRef)(null, { refBys: ids }, context);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
async importTasks(tasks, context) {
|
|
63
|
+
const { domain, tx } = context.state;
|
|
64
|
+
await Promise.all(tasks.map(async (task) => {
|
|
65
|
+
const createdTask = await tx.getRepository(task_1.Task).save(Object.assign({ domain }, task));
|
|
66
|
+
}));
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.TaskMutation = TaskMutation;
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
73
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
74
|
+
(0, type_graphql_1.Mutation)(returns => task_1.Task, { description: 'To create new Task' }),
|
|
75
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('task')),
|
|
76
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
77
|
+
tslib_1.__metadata("design:type", Function),
|
|
78
|
+
tslib_1.__metadata("design:paramtypes", [task_type_1.NewTask, Object]),
|
|
79
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
80
|
+
], TaskMutation.prototype, "createTask", null);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
83
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
84
|
+
(0, type_graphql_1.Mutation)(returns => task_1.Task, { description: 'To modify Task information' }),
|
|
85
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
86
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
87
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
88
|
+
tslib_1.__metadata("design:type", Function),
|
|
89
|
+
tslib_1.__metadata("design:paramtypes", [String, task_type_1.TaskPatch, Object]),
|
|
90
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
91
|
+
], TaskMutation.prototype, "updateTask", null);
|
|
92
|
+
tslib_1.__decorate([
|
|
93
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
94
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
95
|
+
(0, type_graphql_1.Mutation)(returns => [task_1.Task], { description: "To modify multiple Tasks' information" }),
|
|
96
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [task_type_1.TaskPatch])),
|
|
97
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
98
|
+
tslib_1.__metadata("design:type", Function),
|
|
99
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
100
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
101
|
+
], TaskMutation.prototype, "updateMultipleTask", null);
|
|
102
|
+
tslib_1.__decorate([
|
|
103
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
104
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
105
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete Task' }),
|
|
106
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
107
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
108
|
+
tslib_1.__metadata("design:type", Function),
|
|
109
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
110
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
111
|
+
], TaskMutation.prototype, "deleteTask", null);
|
|
112
|
+
tslib_1.__decorate([
|
|
113
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
114
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
115
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple Tasks' }),
|
|
116
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
117
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
118
|
+
tslib_1.__metadata("design:type", Function),
|
|
119
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
120
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
121
|
+
], TaskMutation.prototype, "deleteTasks", null);
|
|
122
|
+
tslib_1.__decorate([
|
|
123
|
+
(0, type_graphql_1.Directive)('@transaction'),
|
|
124
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
125
|
+
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple Tasks' }),
|
|
126
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('tasks', type => [task_type_1.TaskPatch])),
|
|
127
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
128
|
+
tslib_1.__metadata("design:type", Function),
|
|
129
|
+
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
130
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
131
|
+
], TaskMutation.prototype, "importTasks", null);
|
|
132
|
+
exports.TaskMutation = TaskMutation = tslib_1.__decorate([
|
|
133
|
+
(0, type_graphql_1.Resolver)(task_1.Task)
|
|
134
|
+
], TaskMutation);
|
|
135
|
+
//# sourceMappingURL=task-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-mutation.js","sourceRoot":"","sources":["../../../server/service/task/task-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,iCAA6B;AAC7B,2CAAgD;AAGzC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAIjB,AAAN,KAAK,CAAC,UAAU,CAAc,IAAa,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,CAAC,IAAI,iCAC3C,IAAI,KACP,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAKK,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAgB,KAAgB,EAAS,OAAwB;QACrG,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,WAAI,CAAC,CAAA;QACzC,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACpC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM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 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { Task } from './task'\nimport { NewTask, TaskPatch } from './task-type'\n\n@Resolver(Task)\nexport class TaskMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Task, { description: 'To create new Task' })\n async createTask(@Arg('task') task: NewTask, @Ctx() context: ResolverContext): Promise<Task> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Task).save({\n ...task,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Task, { description: 'To modify Task information' })\n async updateTask(@Arg('id') id: string, @Arg('patch') patch: TaskPatch, @Ctx() context: ResolverContext): Promise<Task> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Task)\n const task = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...task,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => [Task], { description: \"To modify multiple Tasks' information\" })\n async updateMultipleTask(\n @Arg('patches', type => [TaskPatch]) patches: TaskPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Task[]> {\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 taskRepo = tx.getRepository(Task)\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 taskRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\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 task = await taskRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taskRepo.save({\n ...task,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete Task' })\n async deleteTask(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Task).delete({ id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To delete multiple Tasks' })\n async deleteTasks(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Task).delete({\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => Boolean, { description: 'To import multiple Tasks' })\n async importTasks(@Arg('tasks', type => [TaskPatch]) tasks: TaskPatch[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n tasks.map(async (task: TaskPatch) => {\n const createdTask: Task = await tx.getRepository(Task).save({ domain, ...task })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ListParam } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Task } from './task';
|
|
4
|
+
import { TaskList } from './task-type';
|
|
5
|
+
import { TaskResource } from '../task-resource/task-resource';
|
|
6
|
+
import { TaskChecklistBinding } from '../task-checklist-binding/task-checklist-binding';
|
|
7
|
+
export declare class DigestedResource {
|
|
8
|
+
type?: string;
|
|
9
|
+
allocated?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class TaskQuery {
|
|
12
|
+
task(id: string, context: ResolverContext): Promise<Task>;
|
|
13
|
+
tasks(params: ListParam, context: ResolverContext): Promise<TaskList>;
|
|
14
|
+
length(task: Task): Promise<string | undefined>;
|
|
15
|
+
children(task: Task, params: ListParam, context: ResolverContext): Promise<Task[]>;
|
|
16
|
+
taskResources(task: Task): Promise<TaskResource[]>;
|
|
17
|
+
resources(task: Task): Promise<DigestedResource[]>;
|
|
18
|
+
taskChecklistBinding(task: Task): Promise<TaskChecklistBinding>;
|
|
19
|
+
updater(task: Task): Promise<User>;
|
|
20
|
+
creator(task: Task): Promise<User>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskQuery = exports.DigestedResource = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const type_graphql_1 = require("type-graphql");
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
8
|
+
const task_1 = require("./task");
|
|
9
|
+
const task_type_1 = require("./task-type");
|
|
10
|
+
const task_resource_1 = require("../task-resource/task-resource");
|
|
11
|
+
const task_checklist_binding_1 = require("../task-checklist-binding/task-checklist-binding");
|
|
12
|
+
let DigestedResource = class DigestedResource {
|
|
13
|
+
};
|
|
14
|
+
exports.DigestedResource = DigestedResource;
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '자원 유형' }),
|
|
17
|
+
tslib_1.__metadata("design:type", String)
|
|
18
|
+
], DigestedResource.prototype, "type", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, type_graphql_1.Field)({ nullable: true, description: '할당량' }),
|
|
21
|
+
tslib_1.__metadata("design:type", Number)
|
|
22
|
+
], DigestedResource.prototype, "allocated", void 0);
|
|
23
|
+
exports.DigestedResource = DigestedResource = tslib_1.__decorate([
|
|
24
|
+
(0, type_graphql_1.ObjectType)()
|
|
25
|
+
], DigestedResource);
|
|
26
|
+
let TaskQuery = class TaskQuery {
|
|
27
|
+
async task(id, context) {
|
|
28
|
+
return await (0, shell_1.getRepository)(task_1.Task).findOne({
|
|
29
|
+
where: { id },
|
|
30
|
+
relations: ['parent', 'taskResources']
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async tasks(params, context) {
|
|
34
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
35
|
+
params,
|
|
36
|
+
repository: await (0, shell_1.getRepository)(task_1.Task),
|
|
37
|
+
alias: 'tasks',
|
|
38
|
+
searchables: ['name', 'code']
|
|
39
|
+
});
|
|
40
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
41
|
+
return { items, total };
|
|
42
|
+
}
|
|
43
|
+
// @FieldResolver(type => Date, { nullable: true, description: 'Calculate or return the start date of the task' })
|
|
44
|
+
// async startDate(@Root() task: Task): Promise<Date | undefined> {
|
|
45
|
+
// if (task.type === TaskType.TASK) {
|
|
46
|
+
// return task.startDate
|
|
47
|
+
// } else {
|
|
48
|
+
// const children = await getRepository(Task).find({ where: { parent: { id: task.id } } })
|
|
49
|
+
// return children.reduce(
|
|
50
|
+
// (earliest, child) => {
|
|
51
|
+
// if (!earliest || (child.startDate && child.startDate < earliest)) {
|
|
52
|
+
// return child.startDate
|
|
53
|
+
// }
|
|
54
|
+
// return earliest
|
|
55
|
+
// },
|
|
56
|
+
// undefined as Date | undefined
|
|
57
|
+
// )
|
|
58
|
+
// }
|
|
59
|
+
// }
|
|
60
|
+
// @FieldResolver(type => Date, { nullable: true, description: 'Calculate or return the end date of the task' })
|
|
61
|
+
// async endDate(@Root() task: Task): Promise<Date | undefined> {
|
|
62
|
+
// if (task.type === TaskType.TASK) {
|
|
63
|
+
// return task.endDate
|
|
64
|
+
// } else {
|
|
65
|
+
// const children = await getRepository(Task).find({ where: { parent: { id: task.id } } })
|
|
66
|
+
// return children.reduce(
|
|
67
|
+
// (latest, child) => {
|
|
68
|
+
// if (!latest || (child.endDate && child.endDate > latest)) {
|
|
69
|
+
// return child.endDate
|
|
70
|
+
// }
|
|
71
|
+
// return latest
|
|
72
|
+
// },
|
|
73
|
+
// undefined as Date | undefined
|
|
74
|
+
// )
|
|
75
|
+
// }
|
|
76
|
+
// }
|
|
77
|
+
// @FieldResolver(type => Number, { nullable: true, description: 'Calculate the duration of the task in days' })
|
|
78
|
+
// async duration(@Root() task: Task): Promise<number | undefined> {
|
|
79
|
+
// if (task.type === TaskType.TASK) {
|
|
80
|
+
// return task.duration
|
|
81
|
+
// } else {
|
|
82
|
+
// const startDate = await this.startDate(task)
|
|
83
|
+
// const endDate = await this.endDate(task)
|
|
84
|
+
// if (startDate && endDate) {
|
|
85
|
+
// const durationInMs = endDate.getTime() - startDate.getTime()
|
|
86
|
+
// const durationInDays = Math.ceil(durationInMs / (1000 * 60 * 60 * 24))
|
|
87
|
+
// return durationInDays
|
|
88
|
+
// }
|
|
89
|
+
// return
|
|
90
|
+
// }
|
|
91
|
+
// }
|
|
92
|
+
async length(task) {
|
|
93
|
+
// if (task.type === TaskType.TASK) {
|
|
94
|
+
return `${task.duration || 1}d`;
|
|
95
|
+
// } else {
|
|
96
|
+
// const startDate = await this.startDate(task)
|
|
97
|
+
// const endDate = await this.endDate(task)
|
|
98
|
+
// if (startDate && endDate) {
|
|
99
|
+
// const durationInMs = endDate.getTime() - startDate.getTime()
|
|
100
|
+
// const durationInDays = Math.ceil(durationInMs / (1000 * 60 * 60 * 24))
|
|
101
|
+
// return `${durationInDays || 1}d`
|
|
102
|
+
// }
|
|
103
|
+
// return
|
|
104
|
+
// }
|
|
105
|
+
}
|
|
106
|
+
async children(task, params, context) {
|
|
107
|
+
const { domain } = context.state;
|
|
108
|
+
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
109
|
+
params,
|
|
110
|
+
alias: 'tasks',
|
|
111
|
+
repository: await (0, shell_1.getRepository)(task_1.Task),
|
|
112
|
+
searchables: ['name', 'code']
|
|
113
|
+
}).andWhere({ parent: { id: task.id } });
|
|
114
|
+
const [items, total] = await queryBuilder.getManyAndCount();
|
|
115
|
+
return items;
|
|
116
|
+
}
|
|
117
|
+
async taskResources(task) {
|
|
118
|
+
return (task === null || task === void 0 ? void 0 : task.id) && (await (0, shell_1.getRepository)(task_resource_1.TaskResource).find({ where: { task: { id: task.id } } }));
|
|
119
|
+
}
|
|
120
|
+
async resources(task) {
|
|
121
|
+
const taskResources = (task === null || task === void 0 ? void 0 : task.id) &&
|
|
122
|
+
(await (0, shell_1.getRepository)(task_resource_1.TaskResource).find({
|
|
123
|
+
where: {
|
|
124
|
+
task: { id: task.id }
|
|
125
|
+
},
|
|
126
|
+
relations: ['resource']
|
|
127
|
+
}));
|
|
128
|
+
return (taskResources || []).map(taskResource => {
|
|
129
|
+
return {
|
|
130
|
+
type: taskResource.resource.name,
|
|
131
|
+
allocated: taskResource.quantity
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
async taskChecklistBinding(task) {
|
|
136
|
+
return await (0, shell_1.getRepository)(task_checklist_binding_1.TaskChecklistBinding).findOneBy({ taskCode: task.code, project: { id: task.projectId } });
|
|
137
|
+
}
|
|
138
|
+
async updater(task) {
|
|
139
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: task.updaterId });
|
|
140
|
+
}
|
|
141
|
+
async creator(task) {
|
|
142
|
+
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: task.creatorId });
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
exports.TaskQuery = TaskQuery;
|
|
146
|
+
tslib_1.__decorate([
|
|
147
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
148
|
+
(0, type_graphql_1.Query)(returns => task_1.Task, { nullable: true, description: 'Fetch a single Task by its ID' }),
|
|
149
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
150
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
151
|
+
tslib_1.__metadata("design:type", Function),
|
|
152
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
153
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
154
|
+
], TaskQuery.prototype, "task", null);
|
|
155
|
+
tslib_1.__decorate([
|
|
156
|
+
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
157
|
+
(0, type_graphql_1.Query)(returns => task_type_1.TaskList, { description: 'Fetch multiple Tasks based on list parameters' }),
|
|
158
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
159
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
160
|
+
tslib_1.__metadata("design:type", Function),
|
|
161
|
+
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
162
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
163
|
+
], TaskQuery.prototype, "tasks", null);
|
|
164
|
+
tslib_1.__decorate([
|
|
165
|
+
(0, type_graphql_1.FieldResolver)(type => String, { nullable: true, description: 'Calculate the duration of the task in days' }),
|
|
166
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
167
|
+
tslib_1.__metadata("design:type", Function),
|
|
168
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task]),
|
|
169
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
170
|
+
], TaskQuery.prototype, "length", null);
|
|
171
|
+
tslib_1.__decorate([
|
|
172
|
+
(0, type_graphql_1.FieldResolver)(type => [task_1.Task]),
|
|
173
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
174
|
+
tslib_1.__param(1, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
175
|
+
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
176
|
+
tslib_1.__metadata("design:type", Function),
|
|
177
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task,
|
|
178
|
+
shell_1.ListParam, Object]),
|
|
179
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
180
|
+
], TaskQuery.prototype, "children", null);
|
|
181
|
+
tslib_1.__decorate([
|
|
182
|
+
(0, type_graphql_1.FieldResolver)(type => [task_resource_1.TaskResource], { description: 'Return the list of resources allocated to the task' }),
|
|
183
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
184
|
+
tslib_1.__metadata("design:type", Function),
|
|
185
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task]),
|
|
186
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
187
|
+
], TaskQuery.prototype, "taskResources", null);
|
|
188
|
+
tslib_1.__decorate([
|
|
189
|
+
(0, type_graphql_1.FieldResolver)(type => [DigestedResource], { description: 'Return the simple list of resources allocated to the task' }),
|
|
190
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
191
|
+
tslib_1.__metadata("design:type", Function),
|
|
192
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task]),
|
|
193
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
194
|
+
], TaskQuery.prototype, "resources", null);
|
|
195
|
+
tslib_1.__decorate([
|
|
196
|
+
(0, type_graphql_1.FieldResolver)(type => task_checklist_binding_1.TaskChecklistBinding, { description: 'Fetch the task checklist binding' }),
|
|
197
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
198
|
+
tslib_1.__metadata("design:type", Function),
|
|
199
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task]),
|
|
200
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
201
|
+
], TaskQuery.prototype, "taskChecklistBinding", null);
|
|
202
|
+
tslib_1.__decorate([
|
|
203
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Fetch the user who last updated the task' }),
|
|
204
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
205
|
+
tslib_1.__metadata("design:type", Function),
|
|
206
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task]),
|
|
207
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
208
|
+
], TaskQuery.prototype, "updater", null);
|
|
209
|
+
tslib_1.__decorate([
|
|
210
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { description: 'Fetch the user who created the task' }),
|
|
211
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
212
|
+
tslib_1.__metadata("design:type", Function),
|
|
213
|
+
tslib_1.__metadata("design:paramtypes", [task_1.Task]),
|
|
214
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
215
|
+
], TaskQuery.prototype, "creator", null);
|
|
216
|
+
exports.TaskQuery = TaskQuery = tslib_1.__decorate([
|
|
217
|
+
(0, type_graphql_1.Resolver)(task_1.Task)
|
|
218
|
+
], TaskQuery);
|
|
219
|
+
//# sourceMappingURL=task-query.js.map
|