@dssp/project 1.0.0-y.0 → 1.0.0
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/package.json +15 -15
- package/dist-client/bootstrap.d.ts +0 -0
- package/dist-client/bootstrap.js +0 -2
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/index.d.ts +0 -1
- package/dist-client/index.js +0 -2
- package/dist-client/index.js.map +0 -1
- package/dist-client/pages/lib/chatbot-widget.d.ts +0 -53
- package/dist-client/pages/lib/chatbot-widget.js +0 -631
- package/dist-client/pages/lib/chatbot-widget.js.map +0 -1
- package/dist-client/pages/lib/select2-component.d.ts +0 -23
- package/dist-client/pages/lib/select2-component.js +0 -181
- package/dist-client/pages/lib/select2-component.js.map +0 -1
- package/dist-client/pages/lib/waether.d.ts +0 -7
- package/dist-client/pages/lib/waether.js +0 -156
- package/dist-client/pages/lib/waether.js.map +0 -1
- package/dist-client/pages/project/component/pagenation.d.ts +0 -18
- package/dist-client/pages/project/component/pagenation.js +0 -142
- package/dist-client/pages/project/component/pagenation.js.map +0 -1
- package/dist-client/pages/project/component/project-update-header.d.ts +0 -1
- package/dist-client/pages/project/component/project-update-header.js +0 -121
- package/dist-client/pages/project/component/project-update-header.js.map +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.d.ts +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js +0 -309
- package/dist-client/pages/project/popup/checklist/task-checklist-attachment-list-popup.js.map +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.d.ts +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js +0 -357
- package/dist-client/pages/project/popup/checklist/task-checklist-comment-list-popup.js.map +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.d.ts +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js +0 -681
- package/dist-client/pages/project/popup/checklist/task-checklist-create-popup.js.map +0 -1
- package/dist-client/pages/project/popup/checklist/task-checklist-view.d.ts +0 -32
- package/dist-client/pages/project/popup/checklist/task-checklist-view.js +0 -621
- package/dist-client/pages/project/popup/checklist/task-checklist-view.js.map +0 -1
- package/dist-client/pages/project/popup/popup-plan-export.d.ts +0 -10
- package/dist-client/pages/project/popup/popup-plan-export.js +0 -242
- package/dist-client/pages/project/popup/popup-plan-export.js.map +0 -1
- package/dist-client/pages/project/popup/popup-plan-upload.d.ts +0 -13
- package/dist-client/pages/project/popup/popup-plan-upload.js +0 -265
- package/dist-client/pages/project/popup/popup-plan-upload.js.map +0 -1
- package/dist-client/pages/project/popup/popup-project-create.d.ts +0 -12
- package/dist-client/pages/project/popup/popup-project-create.js +0 -152
- package/dist-client/pages/project/popup/popup-project-create.js.map +0 -1
- package/dist-client/pages/project/popup/popup-task-upload.d.ts +0 -9
- package/dist-client/pages/project/popup/popup-task-upload.js +0 -105
- package/dist-client/pages/project/popup/popup-task-upload.js.map +0 -1
- package/dist-client/pages/project/project-completed-list.d.ts +0 -23
- package/dist-client/pages/project/project-completed-list.js +0 -322
- package/dist-client/pages/project/project-completed-list.js.map +0 -1
- package/dist-client/pages/project/project-detail.d.ts +0 -41
- package/dist-client/pages/project/project-detail.js +0 -959
- package/dist-client/pages/project/project-detail.js.map +0 -1
- package/dist-client/pages/project/project-list.d.ts +0 -185
- package/dist-client/pages/project/project-list.js +0 -402
- package/dist-client/pages/project/project-list.js.map +0 -1
- package/dist-client/pages/project/project-plan-management.d.ts +0 -33
- package/dist-client/pages/project/project-plan-management.js +0 -487
- package/dist-client/pages/project/project-plan-management.js.map +0 -1
- package/dist-client/pages/project/project-setting-list.d.ts +0 -29
- package/dist-client/pages/project/project-setting-list.js +0 -431
- package/dist-client/pages/project/project-setting-list.js.map +0 -1
- package/dist-client/pages/project/project-task-list.d.ts +0 -18
- package/dist-client/pages/project/project-task-list.js +0 -306
- package/dist-client/pages/project/project-task-list.js.map +0 -1
- package/dist-client/pages/project/project-task.d.ts +0 -51
- package/dist-client/pages/project/project-task.js +0 -686
- package/dist-client/pages/project/project-task.js.map +0 -1
- package/dist-client/pages/project/project-update.d.ts +0 -47
- package/dist-client/pages/project/project-update.js +0 -1197
- package/dist-client/pages/project/project-update.js.map +0 -1
- package/dist-client/pages/resource/construction-detail-type-popup.d.ts +0 -2
- package/dist-client/pages/resource/construction-detail-type-popup.js +0 -197
- package/dist-client/pages/resource/construction-detail-type-popup.js.map +0 -1
- package/dist-client/pages/resource/construction-type-management.d.ts +0 -34
- package/dist-client/pages/resource/construction-type-management.js +0 -200
- package/dist-client/pages/resource/construction-type-management.js.map +0 -1
- package/dist-client/pages/resource/inspection-drawing-type-management.d.ts +0 -48
- package/dist-client/pages/resource/inspection-drawing-type-management.js +0 -234
- package/dist-client/pages/resource/inspection-drawing-type-management.js.map +0 -1
- package/dist-client/pages/resource/inspection-part-popup.d.ts +0 -2
- package/dist-client/pages/resource/inspection-part-popup.js +0 -197
- package/dist-client/pages/resource/inspection-part-popup.js.map +0 -1
- package/dist-client/pages/resource/resource-importer.d.ts +0 -10
- package/dist-client/pages/resource/resource-importer.js +0 -101
- package/dist-client/pages/resource/resource-importer.js.map +0 -1
- package/dist-client/pages/resource/resource-list-page.d.ts +0 -63
- package/dist-client/pages/resource/resource-list-page.js +0 -332
- package/dist-client/pages/resource/resource-list-page.js.map +0 -1
- package/dist-client/pages/resource/worker-type-management.d.ts +0 -34
- package/dist-client/pages/resource/worker-type-management.js +0 -180
- package/dist-client/pages/resource/worker-type-management.js.map +0 -1
- package/dist-client/pages/task/task-importer.d.ts +0 -10
- package/dist-client/pages/task/task-importer.js +0 -101
- package/dist-client/pages/task/task-importer.js.map +0 -1
- package/dist-client/pages/task/task-list-page.d.ts +0 -63
- package/dist-client/pages/task/task-list-page.js +0 -323
- package/dist-client/pages/task/task-list-page.js.map +0 -1
- package/dist-client/pages/task-resource/task-resource-importer.d.ts +0 -10
- package/dist-client/pages/task-resource/task-resource-importer.js +0 -101
- package/dist-client/pages/task-resource/task-resource-importer.js.map +0 -1
- package/dist-client/pages/task-resource/task-resource-list-page.d.ts +0 -63
- package/dist-client/pages/task-resource/task-resource-list-page.js +0 -332
- package/dist-client/pages/task-resource/task-resource-list-page.js.map +0 -1
- package/dist-client/route.d.ts +0 -1
- package/dist-client/route.js +0 -44
- package/dist-client/route.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-server/controllers/export-tasks.d.ts +0 -7
- package/dist-server/controllers/export-tasks.js +0 -29
- package/dist-server/controllers/export-tasks.js.map +0 -1
- package/dist-server/controllers/import-task.d.ts +0 -3
- package/dist-server/controllers/import-task.js +0 -113
- package/dist-server/controllers/import-task.js.map +0 -1
- package/dist-server/controllers/index.d.ts +0 -0
- package/dist-server/controllers/index.js +0 -1
- package/dist-server/controllers/index.js.map +0 -1
- package/dist-server/controllers/parse-excel.d.ts +0 -2
- package/dist-server/controllers/parse-excel.js +0 -74
- package/dist-server/controllers/parse-excel.js.map +0 -1
- package/dist-server/controllers/types.d.ts +0 -18
- package/dist-server/controllers/types.js +0 -3
- package/dist-server/controllers/types.js.map +0 -1
- package/dist-server/index.d.ts +0 -3
- package/dist-server/index.js +0 -7
- package/dist-server/index.js.map +0 -1
- package/dist-server/middlewares/index.d.ts +0 -1
- package/dist-server/middlewares/index.js +0 -7
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/migrations/1723861466413-seed-roles.d.ts +0 -5
- package/dist-server/migrations/1723861466413-seed-roles.js +0 -117
- package/dist-server/migrations/1723861466413-seed-roles.js.map +0 -1
- package/dist-server/migrations/1723861466414-seed-codes.d.ts +0 -5
- package/dist-server/migrations/1723861466414-seed-codes.js +0 -150
- package/dist-server/migrations/1723861466414-seed-codes.js.map +0 -1
- package/dist-server/migrations/1723861476419-seed-resources.d.ts +0 -5
- package/dist-server/migrations/1723861476419-seed-resources.js +0 -57
- package/dist-server/migrations/1723861476419-seed-resources.js.map +0 -1
- package/dist-server/migrations/1723861478420-seed-/bsample-project.d.ts +0 -5
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js +0 -68
- package/dist-server/migrations/1723861478420-seed-/bsample-project.js.map +0 -1
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.d.ts +0 -5
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js +0 -189
- package/dist-server/migrations/1723861478421-seed-/bsample-tasks.js.map +0 -1
- package/dist-server/migrations/index.d.ts +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/routes.d.ts +0 -1
- package/dist-server/routes.js +0 -105
- package/dist-server/routes.js.map +0 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.d.ts +0 -6
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js +0 -56
- package/dist-server/service/construction-detail-type/construction-detail-type-mutation.js.map +0 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-query.d.ts +0 -9
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js +0 -53
- package/dist-server/service/construction-detail-type/construction-detail-type-query.js.map +0 -1
- package/dist-server/service/construction-detail-type/construction-detail-type-type.d.ts +0 -11
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js +0 -43
- package/dist-server/service/construction-detail-type/construction-detail-type-type.js.map +0 -1
- package/dist-server/service/construction-detail-type/construction-detail-type.d.ts +0 -15
- package/dist-server/service/construction-detail-type/construction-detail-type.js +0 -69
- package/dist-server/service/construction-detail-type/construction-detail-type.js.map +0 -1
- package/dist-server/service/construction-detail-type/index.d.ts +0 -5
- package/dist-server/service/construction-detail-type/index.js +0 -9
- package/dist-server/service/construction-detail-type/index.js.map +0 -1
- package/dist-server/service/construction-type/construction-type-mutation.d.ts +0 -6
- package/dist-server/service/construction-type/construction-type-mutation.js +0 -64
- package/dist-server/service/construction-type/construction-type-mutation.js.map +0 -1
- package/dist-server/service/construction-type/construction-type-query.d.ts +0 -13
- package/dist-server/service/construction-type/construction-type-query.js +0 -92
- package/dist-server/service/construction-type/construction-type-query.js.map +0 -1
- package/dist-server/service/construction-type/construction-type-type.d.ts +0 -11
- package/dist-server/service/construction-type/construction-type-type.js +0 -43
- package/dist-server/service/construction-type/construction-type-type.js.map +0 -1
- package/dist-server/service/construction-type/construction-type.d.ts +0 -18
- package/dist-server/service/construction-type/construction-type.js +0 -83
- package/dist-server/service/construction-type/construction-type.js.map +0 -1
- package/dist-server/service/construction-type/index.d.ts +0 -5
- package/dist-server/service/construction-type/index.js +0 -9
- package/dist-server/service/construction-type/index.js.map +0 -1
- package/dist-server/service/index.d.ts +0 -15
- package/dist-server/service/index.js +0 -59
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/inspection-drawing-type/index.d.ts +0 -5
- package/dist-server/service/inspection-drawing-type/index.js +0 -9
- package/dist-server/service/inspection-drawing-type/index.js.map +0 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.d.ts +0 -6
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js +0 -64
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-mutation.js.map +0 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.d.ts +0 -12
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js +0 -83
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-query.js.map +0 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.d.ts +0 -10
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js +0 -39
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type-type.js.map +0 -1
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.d.ts +0 -16
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js +0 -72
- package/dist-server/service/inspection-drawing-type/inspection-drawing-type.js.map +0 -1
- package/dist-server/service/inspection-part/index.d.ts +0 -5
- package/dist-server/service/inspection-part/index.js +0 -9
- package/dist-server/service/inspection-part/index.js.map +0 -1
- package/dist-server/service/inspection-part/inspection-part-mutation.d.ts +0 -6
- package/dist-server/service/inspection-part/inspection-part-mutation.js +0 -55
- package/dist-server/service/inspection-part/inspection-part-mutation.js.map +0 -1
- package/dist-server/service/inspection-part/inspection-part-query.d.ts +0 -10
- package/dist-server/service/inspection-part/inspection-part-query.js +0 -66
- package/dist-server/service/inspection-part/inspection-part-query.js.map +0 -1
- package/dist-server/service/inspection-part/inspection-part-type.d.ts +0 -11
- package/dist-server/service/inspection-part/inspection-part-type.js +0 -43
- package/dist-server/service/inspection-part/inspection-part-type.js.map +0 -1
- package/dist-server/service/inspection-part/inspection-part.d.ts +0 -15
- package/dist-server/service/inspection-part/inspection-part.js +0 -69
- package/dist-server/service/inspection-part/inspection-part.js.map +0 -1
- package/dist-server/service/manager/index.d.ts +0 -7
- package/dist-server/service/manager/index.js +0 -11
- package/dist-server/service/manager/index.js.map +0 -1
- package/dist-server/service/manager/manager-mutation.d.ts +0 -5
- package/dist-server/service/manager/manager-mutation.js +0 -39
- package/dist-server/service/manager/manager-mutation.js.map +0 -1
- package/dist-server/service/manager/manager-query.d.ts +0 -4
- package/dist-server/service/manager/manager-query.js +0 -39
- package/dist-server/service/manager/manager-query.js.map +0 -1
- package/dist-server/service/manager/manager-type.d.ts +0 -15
- package/dist-server/service/manager/manager-type.js +0 -62
- package/dist-server/service/manager/manager-type.js.map +0 -1
- package/dist-server/service/manager/manager.d.ts +0 -8
- package/dist-server/service/manager/manager.js +0 -41
- package/dist-server/service/manager/manager.js.map +0 -1
- package/dist-server/service/project/index.d.ts +0 -5
- package/dist-server/service/project/index.js +0 -9
- package/dist-server/service/project/index.js.map +0 -1
- package/dist-server/service/project/project-mutation.d.ts +0 -12
- package/dist-server/service/project/project-mutation.js +0 -339
- package/dist-server/service/project/project-mutation.js.map +0 -1
- package/dist-server/service/project/project-query.d.ts +0 -23
- package/dist-server/service/project/project-query.js +0 -215
- package/dist-server/service/project/project-query.js.map +0 -1
- package/dist-server/service/project/project-type.d.ts +0 -36
- package/dist-server/service/project/project-type.js +0 -128
- package/dist-server/service/project/project-type.js.map +0 -1
- package/dist-server/service/project/project.d.ts +0 -52
- package/dist-server/service/project/project.js +0 -190
- package/dist-server/service/project/project.js.map +0 -1
- package/dist-server/service/resource/index.d.ts +0 -6
- package/dist-server/service/resource/index.js +0 -10
- package/dist-server/service/resource/index.js.map +0 -1
- package/dist-server/service/resource/resource-mutation.d.ts +0 -10
- package/dist-server/service/resource/resource-mutation.js +0 -132
- package/dist-server/service/resource/resource-mutation.js.map +0 -1
- package/dist-server/service/resource/resource-query.d.ts +0 -11
- package/dist-server/service/resource/resource-query.js +0 -81
- package/dist-server/service/resource/resource-query.js.map +0 -1
- package/dist-server/service/resource/resource-type.d.ts +0 -17
- package/dist-server/service/resource/resource-type.js +0 -65
- package/dist-server/service/resource/resource-type.js.map +0 -1
- package/dist-server/service/resource/resource.d.ts +0 -24
- package/dist-server/service/resource/resource.js +0 -93
- package/dist-server/service/resource/resource.js.map +0 -1
- package/dist-server/service/task/index.d.ts +0 -5
- package/dist-server/service/task/index.js +0 -9
- package/dist-server/service/task/index.js.map +0 -1
- package/dist-server/service/task/task-mutation.d.ts +0 -10
- package/dist-server/service/task/task-mutation.js +0 -135
- package/dist-server/service/task/task-mutation.js.map +0 -1
- package/dist-server/service/task/task-query.d.ts +0 -21
- package/dist-server/service/task/task-query.js +0 -219
- package/dist-server/service/task/task-query.js.map +0 -1
- package/dist-server/service/task/task-type.d.ts +0 -31
- package/dist-server/service/task/task-type.js +0 -114
- package/dist-server/service/task/task-type.js.map +0 -1
- package/dist-server/service/task/task.d.ts +0 -35
- package/dist-server/service/task/task.js +0 -151
- package/dist-server/service/task/task.js.map +0 -1
- package/dist-server/service/task-checklist-binding/index.d.ts +0 -5
- package/dist-server/service/task-checklist-binding/index.js +0 -9
- package/dist-server/service/task-checklist-binding/index.js.map +0 -1
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.d.ts +0 -5
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js +0 -186
- package/dist-server/service/task-checklist-binding/task-checklist-binding-mutation.js.map +0 -1
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.d.ts +0 -8
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js +0 -61
- package/dist-server/service/task-checklist-binding/task-checklist-binding-query.js.map +0 -1
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.d.ts +0 -15
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js +0 -57
- package/dist-server/service/task-checklist-binding/task-checklist-binding-type.js.map +0 -1
- package/dist-server/service/task-checklist-binding/task-checklist-binding.d.ts +0 -22
- package/dist-server/service/task-checklist-binding/task-checklist-binding.js +0 -106
- package/dist-server/service/task-checklist-binding/task-checklist-binding.js.map +0 -1
- package/dist-server/service/task-resource/index.d.ts +0 -6
- package/dist-server/service/task-resource/index.js +0 -10
- package/dist-server/service/task-resource/index.js.map +0 -1
- package/dist-server/service/task-resource/task-resource-mutation.d.ts +0 -10
- package/dist-server/service/task-resource/task-resource-mutation.js +0 -132
- package/dist-server/service/task-resource/task-resource-mutation.js.map +0 -1
- package/dist-server/service/task-resource/task-resource-query.d.ts +0 -7
- package/dist-server/service/task-resource/task-resource-query.js +0 -50
- package/dist-server/service/task-resource/task-resource-query.js.map +0 -1
- package/dist-server/service/task-resource/task-resource-type.d.ts +0 -17
- package/dist-server/service/task-resource/task-resource-type.js +0 -65
- package/dist-server/service/task-resource/task-resource-type.js.map +0 -1
- package/dist-server/service/task-resource/task-resource.d.ts +0 -13
- package/dist-server/service/task-resource/task-resource.js +0 -59
- package/dist-server/service/task-resource/task-resource.js.map +0 -1
- package/dist-server/service/worker-type/index.d.ts +0 -5
- package/dist-server/service/worker-type/index.js +0 -9
- package/dist-server/service/worker-type/index.js.map +0 -1
- package/dist-server/service/worker-type/worker-type-mutation.d.ts +0 -6
- package/dist-server/service/worker-type/worker-type-mutation.js +0 -64
- package/dist-server/service/worker-type/worker-type-mutation.js.map +0 -1
- package/dist-server/service/worker-type/worker-type-query.d.ts +0 -11
- package/dist-server/service/worker-type/worker-type-query.js +0 -78
- package/dist-server/service/worker-type/worker-type-query.js.map +0 -1
- package/dist-server/service/worker-type/worker-type-type.d.ts +0 -11
- package/dist-server/service/worker-type/worker-type-type.js +0 -43
- package/dist-server/service/worker-type/worker-type-type.js.map +0 -1
- package/dist-server/service/worker-type/worker-type.d.ts +0 -16
- package/dist-server/service/worker-type/worker-type.js +0 -77
- package/dist-server/service/worker-type/worker-type.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskResourceMutation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const task_resource_1 = require("./task-resource");
|
|
8
|
-
const task_resource_type_1 = require("./task-resource-type");
|
|
9
|
-
let TaskResourceMutation = class TaskResourceMutation {
|
|
10
|
-
async createTaskResource(taskResource, context) {
|
|
11
|
-
const { domain, user, tx } = context.state;
|
|
12
|
-
const result = await tx.getRepository(task_resource_1.TaskResource).save(Object.assign(Object.assign({}, taskResource), { domain, creator: user, updater: user }));
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
async updateTaskResource(id, patch, context) {
|
|
16
|
-
const { domain, user, tx } = context.state;
|
|
17
|
-
const repository = tx.getRepository(task_resource_1.TaskResource);
|
|
18
|
-
const taskResource = await repository.findOne({
|
|
19
|
-
where: { id }
|
|
20
|
-
});
|
|
21
|
-
const result = await repository.save(Object.assign(Object.assign(Object.assign({}, taskResource), patch), { updater: user }));
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
async updateMultipleTaskResource(patches, context) {
|
|
25
|
-
const { domain, user, tx } = context.state;
|
|
26
|
-
let results = [];
|
|
27
|
-
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
28
|
-
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
29
|
-
const taskResourceRepo = tx.getRepository(task_resource_1.TaskResource);
|
|
30
|
-
if (_createRecords.length > 0) {
|
|
31
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
32
|
-
const newRecord = _createRecords[i];
|
|
33
|
-
const result = await taskResourceRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
34
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (_updateRecords.length > 0) {
|
|
38
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
|
39
|
-
const updateRecord = _updateRecords[i];
|
|
40
|
-
const taskResource = await taskResourceRepo.findOneBy({ id: updateRecord.id });
|
|
41
|
-
const result = await taskResourceRepo.save(Object.assign(Object.assign(Object.assign({}, taskResource), updateRecord), { updater: user }));
|
|
42
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return results;
|
|
46
|
-
}
|
|
47
|
-
async deleteTaskResource(id, context) {
|
|
48
|
-
const { domain, tx } = context.state;
|
|
49
|
-
await tx.getRepository(task_resource_1.TaskResource).delete({ id });
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
async deleteTaskResources(ids, context) {
|
|
53
|
-
const { domain, tx } = context.state;
|
|
54
|
-
await tx.getRepository(task_resource_1.TaskResource).delete({
|
|
55
|
-
id: (0, typeorm_1.In)(ids)
|
|
56
|
-
});
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
async importTaskResources(taskResources, context) {
|
|
60
|
-
const { domain, tx } = context.state;
|
|
61
|
-
await Promise.all(taskResources.map(async (taskResource) => {
|
|
62
|
-
const createdTaskResource = await tx.getRepository(task_resource_1.TaskResource).save(Object.assign({ domain }, taskResource));
|
|
63
|
-
}));
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports.TaskResourceMutation = TaskResourceMutation;
|
|
68
|
-
tslib_1.__decorate([
|
|
69
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
70
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
71
|
-
(0, type_graphql_1.Mutation)(returns => task_resource_1.TaskResource, { description: 'To create new TaskResource' }),
|
|
72
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('taskResource')),
|
|
73
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
74
|
-
tslib_1.__metadata("design:type", Function),
|
|
75
|
-
tslib_1.__metadata("design:paramtypes", [task_resource_type_1.NewTaskResource, Object]),
|
|
76
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
77
|
-
], TaskResourceMutation.prototype, "createTaskResource", null);
|
|
78
|
-
tslib_1.__decorate([
|
|
79
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
80
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
81
|
-
(0, type_graphql_1.Mutation)(returns => task_resource_1.TaskResource, { description: 'To modify TaskResource information' }),
|
|
82
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
83
|
-
tslib_1.__param(1, (0, type_graphql_1.Arg)('patch')),
|
|
84
|
-
tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
|
|
85
|
-
tslib_1.__metadata("design:type", Function),
|
|
86
|
-
tslib_1.__metadata("design:paramtypes", [String, task_resource_type_1.TaskResourcePatch, Object]),
|
|
87
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
88
|
-
], TaskResourceMutation.prototype, "updateTaskResource", null);
|
|
89
|
-
tslib_1.__decorate([
|
|
90
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
91
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
92
|
-
(0, type_graphql_1.Mutation)(returns => [task_resource_1.TaskResource], { description: "To modify multiple TaskResources' information" }),
|
|
93
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [task_resource_type_1.TaskResourcePatch])),
|
|
94
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
95
|
-
tslib_1.__metadata("design:type", Function),
|
|
96
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
97
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
98
|
-
], TaskResourceMutation.prototype, "updateMultipleTaskResource", null);
|
|
99
|
-
tslib_1.__decorate([
|
|
100
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
101
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
102
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete TaskResource' }),
|
|
103
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
104
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
105
|
-
tslib_1.__metadata("design:type", Function),
|
|
106
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
107
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
108
|
-
], TaskResourceMutation.prototype, "deleteTaskResource", null);
|
|
109
|
-
tslib_1.__decorate([
|
|
110
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
111
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
112
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple TaskResources' }),
|
|
113
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
114
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
115
|
-
tslib_1.__metadata("design:type", Function),
|
|
116
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
117
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
118
|
-
], TaskResourceMutation.prototype, "deleteTaskResources", null);
|
|
119
|
-
tslib_1.__decorate([
|
|
120
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
121
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "mutation", domainOwnerGranted: true)'),
|
|
122
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To import multiple TaskResources' }),
|
|
123
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('taskResources', type => [task_resource_type_1.TaskResourcePatch])),
|
|
124
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
125
|
-
tslib_1.__metadata("design:type", Function),
|
|
126
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
127
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
128
|
-
], TaskResourceMutation.prototype, "importTaskResources", null);
|
|
129
|
-
exports.TaskResourceMutation = TaskResourceMutation = tslib_1.__decorate([
|
|
130
|
-
(0, type_graphql_1.Resolver)(task_resource_1.TaskResource)
|
|
131
|
-
], TaskResourceMutation);
|
|
132
|
-
//# sourceMappingURL=task-resource-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-resource-mutation.js","sourceRoot":"","sources":["../../../server/service/task-resource/task-resource-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,mDAA8C;AAC9C,6DAAyE;AAGlE,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAIzB,AAAN,KAAK,CAAC,kBAAkB,CACD,YAA6B,EAC3C,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,4BAAY,CAA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EAAE,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAE/E,mBAAA,IAAA,kBAAG,EAAC,eAAe,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,sCAAiB,CAAC,CAAC,CAAA;IACjD,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;+DAWP;+BAnIU,oBAAoB;IADhC,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,oBAAoB,CAoIhC","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { TaskResource } from './task-resource'\nimport { NewTaskResource, TaskResourcePatch } from './task-resource-type'\n\n@Resolver(TaskResource)\nexport class TaskResourceMutation {\n @Directive('@transaction')\n @Directive('@privilege(category: \"project\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Mutation(returns => TaskResource, { description: 'To create new TaskResource' })\n async createTaskResource(\n @Arg('taskResource') taskResource: NewTaskResource,\n @Ctx() context: ResolverContext\n ): Promise<TaskResource> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(TaskResource).save({\n ...taskResource,\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 => TaskResource, { description: 'To modify TaskResource information' })\n async updateTaskResource(\n @Arg('id') id: string,\n @Arg('patch') patch: TaskResourcePatch,\n @Ctx() context: ResolverContext\n ): Promise<TaskResource> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(TaskResource)\n const taskResource = await repository.findOne({\n where: { id }\n })\n\n const result = await repository.save({\n ...taskResource,\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 => [TaskResource], { description: \"To modify multiple TaskResources' information\" })\n async updateMultipleTaskResource(\n @Arg('patches', type => [TaskResourcePatch]) patches: TaskResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<TaskResource[]> {\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 taskResourceRepo = tx.getRepository(TaskResource)\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 taskResourceRepo.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 taskResource = await taskResourceRepo.findOneBy({ id: updateRecord.id })\n\n const result = await taskResourceRepo.save({\n ...taskResource,\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 TaskResource' })\n async deleteTaskResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaskResource).delete({ id })\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 TaskResources' })\n async deleteTaskResources(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(TaskResource).delete({\n id: In(ids)\n })\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 TaskResources' })\n async importTaskResources(\n @Arg('taskResources', type => [TaskResourcePatch]) taskResources: TaskResourcePatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n taskResources.map(async (taskResource: TaskResourcePatch) => {\n const createdTaskResource: TaskResource = await tx.getRepository(TaskResource).save({ domain, ...taskResource })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ListParam } from '@things-factory/shell';
|
|
2
|
-
import { TaskResource } from './task-resource';
|
|
3
|
-
import { TaskResourceList } from './task-resource-type';
|
|
4
|
-
export declare class TaskResourceQuery {
|
|
5
|
-
taskResource(id: string, context: ResolverContext): Promise<TaskResource>;
|
|
6
|
-
taskResources(params: ListParam, context: ResolverContext): Promise<TaskResourceList>;
|
|
7
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskResourceQuery = 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 task_resource_1 = require("./task-resource");
|
|
8
|
-
const task_resource_type_1 = require("./task-resource-type");
|
|
9
|
-
let TaskResourceQuery = class TaskResourceQuery {
|
|
10
|
-
async taskResource(id, context) {
|
|
11
|
-
const { domain } = context.state;
|
|
12
|
-
return await (0, shell_1.getRepository)(task_resource_1.TaskResource).findOne({
|
|
13
|
-
where: { id }
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async taskResources(params, context) {
|
|
17
|
-
const { domain } = context.state;
|
|
18
|
-
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
19
|
-
domain,
|
|
20
|
-
params,
|
|
21
|
-
repository: await (0, shell_1.getRepository)(task_resource_1.TaskResource),
|
|
22
|
-
searchables: ['name', 'description']
|
|
23
|
-
});
|
|
24
|
-
const [items, total] = await queryBuilder.getManyAndCount();
|
|
25
|
-
return { items, total };
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
exports.TaskResourceQuery = TaskResourceQuery;
|
|
29
|
-
tslib_1.__decorate([
|
|
30
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
31
|
-
(0, type_graphql_1.Query)(returns => task_resource_1.TaskResource, { nullable: true, description: 'To fetch a TaskResource' }),
|
|
32
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
33
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
34
|
-
tslib_1.__metadata("design:type", Function),
|
|
35
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
36
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
37
|
-
], TaskResourceQuery.prototype, "taskResource", null);
|
|
38
|
-
tslib_1.__decorate([
|
|
39
|
-
(0, type_graphql_1.Directive)('@privilege(category: "project", privilege: "query", domainOwnerGranted: true)'),
|
|
40
|
-
(0, type_graphql_1.Query)(returns => task_resource_type_1.TaskResourceList, { description: 'To fetch multiple TaskResources' }),
|
|
41
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
42
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
43
|
-
tslib_1.__metadata("design:type", Function),
|
|
44
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
45
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
46
|
-
], TaskResourceQuery.prototype, "taskResources", null);
|
|
47
|
-
exports.TaskResourceQuery = TaskResourceQuery = tslib_1.__decorate([
|
|
48
|
-
(0, type_graphql_1.Resolver)(task_resource_1.TaskResource)
|
|
49
|
-
], TaskResourceQuery);
|
|
50
|
-
//# sourceMappingURL=task-resource-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-resource-query.js","sourceRoot":"","sources":["../../../server/service/task-resource/task-resource-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8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CAAiC,EAAE,CAAC;IAClE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;sDAa5C;4BA1BU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CA2B7B","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 { TaskResource } from './task-resource'\nimport { TaskResourceList } from './task-resource-type'\n\n@Resolver(TaskResource)\nexport class TaskResourceQuery {\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => TaskResource!, { nullable: true, description: 'To fetch a TaskResource' })\n async taskResource(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<TaskResource> {\n const { domain } = context.state\n\n return await getRepository(TaskResource).findOne({\n where: { id }\n })\n }\n\n @Directive('@privilege(category: \"project\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => TaskResourceList, { description: 'To fetch multiple TaskResources' })\n async taskResources(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<TaskResourceList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(TaskResource),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TaskResource } from './task-resource';
|
|
2
|
-
export declare class NewTaskResource {
|
|
3
|
-
taskId: string;
|
|
4
|
-
resourceId: string;
|
|
5
|
-
quantity: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class TaskResourcePatch {
|
|
8
|
-
id?: string;
|
|
9
|
-
taskId?: string;
|
|
10
|
-
resourceId?: string;
|
|
11
|
-
quantity?: number;
|
|
12
|
-
cuFlag?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class TaskResourceList {
|
|
15
|
-
items: TaskResource[];
|
|
16
|
-
total: number;
|
|
17
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskResourceList = exports.TaskResourcePatch = exports.NewTaskResource = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const task_resource_1 = require("./task-resource");
|
|
7
|
-
let NewTaskResource = class NewTaskResource {
|
|
8
|
-
};
|
|
9
|
-
exports.NewTaskResource = NewTaskResource;
|
|
10
|
-
tslib_1.__decorate([
|
|
11
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
12
|
-
tslib_1.__metadata("design:type", String)
|
|
13
|
-
], NewTaskResource.prototype, "taskId", void 0);
|
|
14
|
-
tslib_1.__decorate([
|
|
15
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
16
|
-
tslib_1.__metadata("design:type", String)
|
|
17
|
-
], NewTaskResource.prototype, "resourceId", void 0);
|
|
18
|
-
tslib_1.__decorate([
|
|
19
|
-
(0, type_graphql_1.Field)(),
|
|
20
|
-
tslib_1.__metadata("design:type", Number)
|
|
21
|
-
], NewTaskResource.prototype, "quantity", void 0);
|
|
22
|
-
exports.NewTaskResource = NewTaskResource = tslib_1.__decorate([
|
|
23
|
-
(0, type_graphql_1.InputType)()
|
|
24
|
-
], NewTaskResource);
|
|
25
|
-
let TaskResourcePatch = class TaskResourcePatch {
|
|
26
|
-
};
|
|
27
|
-
exports.TaskResourcePatch = TaskResourcePatch;
|
|
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
|
-
], TaskResourcePatch.prototype, "id", void 0);
|
|
32
|
-
tslib_1.__decorate([
|
|
33
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
34
|
-
tslib_1.__metadata("design:type", String)
|
|
35
|
-
], TaskResourcePatch.prototype, "taskId", void 0);
|
|
36
|
-
tslib_1.__decorate([
|
|
37
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
38
|
-
tslib_1.__metadata("design:type", String)
|
|
39
|
-
], TaskResourcePatch.prototype, "resourceId", void 0);
|
|
40
|
-
tslib_1.__decorate([
|
|
41
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
42
|
-
tslib_1.__metadata("design:type", Number)
|
|
43
|
-
], TaskResourcePatch.prototype, "quantity", void 0);
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
-
tslib_1.__metadata("design:type", String)
|
|
47
|
-
], TaskResourcePatch.prototype, "cuFlag", void 0);
|
|
48
|
-
exports.TaskResourcePatch = TaskResourcePatch = tslib_1.__decorate([
|
|
49
|
-
(0, type_graphql_1.InputType)()
|
|
50
|
-
], TaskResourcePatch);
|
|
51
|
-
let TaskResourceList = class TaskResourceList {
|
|
52
|
-
};
|
|
53
|
-
exports.TaskResourceList = TaskResourceList;
|
|
54
|
-
tslib_1.__decorate([
|
|
55
|
-
(0, type_graphql_1.Field)(type => [task_resource_1.TaskResource]),
|
|
56
|
-
tslib_1.__metadata("design:type", Array)
|
|
57
|
-
], TaskResourceList.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
|
-
], TaskResourceList.prototype, "total", void 0);
|
|
62
|
-
exports.TaskResourceList = TaskResourceList = tslib_1.__decorate([
|
|
63
|
-
(0, type_graphql_1.ObjectType)()
|
|
64
|
-
], TaskResourceList);
|
|
65
|
-
//# sourceMappingURL=task-resource-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-resource-type.js","sourceRoot":"","sources":["../../../server/service/task-resource/task-resource-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,mDAA8C;AAGvC,IAAM,eAAe,GAArB,MAAM,eAAe;CAS3B,CAAA;AATY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;+CACJ;AAGd;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mDACA;AAGlB;IADC,IAAA,oBAAK,GAAE;;iDACQ;0BARL,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAS3B;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAe7B,CAAA;AAfY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACvB;AAGf;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACnB;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;4BAdJ,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAe7B;AAGM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAM5B,CAAA;AANY,4CAAgB;AAE3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;;+CACT;AAGrB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;+CACN;2BALF,gBAAgB;IAD5B,IAAA,yBAAU,GAAE;GACA,gBAAgB,CAM5B","sourcesContent":["import { InputType, Field, ID, ObjectType, Int } from 'type-graphql'\nimport { TaskResource } from './task-resource'\n\n@InputType()\nexport class NewTaskResource {\n @Field(type => ID)\n taskId: string\n\n @Field(type => ID)\n resourceId: string\n\n @Field()\n quantity: number\n}\n\n@InputType()\nexport class TaskResourcePatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => ID, { nullable: true })\n taskId?: string\n\n @Field(type => ID, { nullable: true })\n resourceId?: string\n\n @Field({ nullable: true })\n quantity?: number\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class TaskResourceList {\n @Field(type => [TaskResource])\n items: TaskResource[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Task } from '../task/task';
|
|
2
|
-
import { Resource } from '../resource/resource';
|
|
3
|
-
export declare class TaskResource {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
task: Task;
|
|
6
|
-
taskId: string;
|
|
7
|
-
resource: Resource;
|
|
8
|
-
resourceId: string;
|
|
9
|
-
quantity: number;
|
|
10
|
-
createdAt?: Date;
|
|
11
|
-
updatedAt?: Date;
|
|
12
|
-
deletedAt?: Date;
|
|
13
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TaskResource = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const typeorm_1 = require("typeorm");
|
|
6
|
-
const type_graphql_1 = require("type-graphql");
|
|
7
|
-
const task_1 = require("../task/task");
|
|
8
|
-
const resource_1 = require("../resource/resource");
|
|
9
|
-
let TaskResource = class TaskResource {
|
|
10
|
-
};
|
|
11
|
-
exports.TaskResource = TaskResource;
|
|
12
|
-
tslib_1.__decorate([
|
|
13
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
14
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
15
|
-
tslib_1.__metadata("design:type", String)
|
|
16
|
-
], TaskResource.prototype, "id", void 0);
|
|
17
|
-
tslib_1.__decorate([
|
|
18
|
-
(0, typeorm_1.ManyToOne)(() => task_1.Task, task => task.taskResources, { nullable: false }),
|
|
19
|
-
(0, type_graphql_1.Field)(type => task_1.Task),
|
|
20
|
-
tslib_1.__metadata("design:type", task_1.Task)
|
|
21
|
-
], TaskResource.prototype, "task", void 0);
|
|
22
|
-
tslib_1.__decorate([
|
|
23
|
-
(0, typeorm_1.RelationId)((taskResource) => taskResource.task),
|
|
24
|
-
tslib_1.__metadata("design:type", String)
|
|
25
|
-
], TaskResource.prototype, "taskId", void 0);
|
|
26
|
-
tslib_1.__decorate([
|
|
27
|
-
(0, typeorm_1.ManyToOne)(() => resource_1.Resource, resource => resource.taskResources, { nullable: false }),
|
|
28
|
-
(0, type_graphql_1.Field)(type => resource_1.Resource),
|
|
29
|
-
tslib_1.__metadata("design:type", resource_1.Resource)
|
|
30
|
-
], TaskResource.prototype, "resource", void 0);
|
|
31
|
-
tslib_1.__decorate([
|
|
32
|
-
(0, typeorm_1.RelationId)((taskResource) => taskResource.resource),
|
|
33
|
-
tslib_1.__metadata("design:type", String)
|
|
34
|
-
], TaskResource.prototype, "resourceId", void 0);
|
|
35
|
-
tslib_1.__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({ type: 'float', nullable: false, comment: '소요량 (예: 8, 5 등)' }),
|
|
37
|
-
(0, type_graphql_1.Field)({ nullable: false }),
|
|
38
|
-
tslib_1.__metadata("design:type", Number)
|
|
39
|
-
], TaskResource.prototype, "quantity", void 0);
|
|
40
|
-
tslib_1.__decorate([
|
|
41
|
-
(0, typeorm_1.CreateDateColumn)(),
|
|
42
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
43
|
-
tslib_1.__metadata("design:type", Date)
|
|
44
|
-
], TaskResource.prototype, "createdAt", void 0);
|
|
45
|
-
tslib_1.__decorate([
|
|
46
|
-
(0, typeorm_1.UpdateDateColumn)(),
|
|
47
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
48
|
-
tslib_1.__metadata("design:type", Date)
|
|
49
|
-
], TaskResource.prototype, "updatedAt", void 0);
|
|
50
|
-
tslib_1.__decorate([
|
|
51
|
-
(0, typeorm_1.DeleteDateColumn)(),
|
|
52
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
53
|
-
tslib_1.__metadata("design:type", Date)
|
|
54
|
-
], TaskResource.prototype, "deletedAt", void 0);
|
|
55
|
-
exports.TaskResource = TaskResource = tslib_1.__decorate([
|
|
56
|
-
(0, typeorm_1.Entity)(),
|
|
57
|
-
(0, type_graphql_1.ObjectType)({ description: '작업에 소요되는 자원' })
|
|
58
|
-
], TaskResource);
|
|
59
|
-
//# sourceMappingURL=task-resource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-resource.js","sourceRoot":"","sources":["../../../server/service/task-resource/task-resource.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AACpD,uCAAmC;AACnC,mDAA+C;AAIxC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAkCxB,CAAA;AAlCY,oCAAY;AAGd;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;wCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,WAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACtE,IAAA,oBAAK,EAAC,IAAI,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teDateColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\nimport { Task } from '../task/task'\nimport { Resource } from '../resource/resource'\n\n@Entity()\n@ObjectType({ description: '작업에 소요되는 자원' })\nexport class TaskResource {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(() => Task, task => task.taskResources, { nullable: false })\n @Field(type => Task)\n task: Task\n\n @RelationId((taskResource: TaskResource) => taskResource.task)\n taskId: string\n\n @ManyToOne(() => Resource, resource => resource.taskResources, { nullable: false })\n @Field(type => Resource)\n resource: Resource\n\n @RelationId((taskResource: TaskResource) => taskResource.resource)\n resourceId: string\n\n @Column({ type: 'float', nullable: false, comment: '소요량 (예: 8, 5 등)' })\n @Field({ nullable: false })\n quantity: number\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"]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { WorkerType } from './worker-type';
|
|
2
|
-
import { WorkerTypeQuery } from './worker-type-query';
|
|
3
|
-
import { WorkerTypeMutation } from './worker-type-mutation';
|
|
4
|
-
export declare const entities: (typeof WorkerType)[];
|
|
5
|
-
export declare const resolvers: (typeof WorkerTypeQuery | typeof WorkerTypeMutation)[];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const worker_type_1 = require("./worker-type");
|
|
5
|
-
const worker_type_query_1 = require("./worker-type-query");
|
|
6
|
-
const worker_type_mutation_1 = require("./worker-type-mutation");
|
|
7
|
-
exports.entities = [worker_type_1.WorkerType];
|
|
8
|
-
exports.resolvers = [worker_type_query_1.WorkerTypeQuery, worker_type_mutation_1.WorkerTypeMutation];
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/worker-type/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,2DAAqD;AACrD,iEAA2D;AAE9C,QAAA,QAAQ,GAAG,CAAC,wBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,mCAAe,EAAE,yCAAkB,CAAC,CAAA","sourcesContent":["import { WorkerType } from './worker-type'\nimport { WorkerTypeQuery } from './worker-type-query'\nimport { WorkerTypeMutation } from './worker-type-mutation'\n\nexport const entities = [WorkerType]\nexport const resolvers = [WorkerTypeQuery, WorkerTypeMutation]\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { WorkerType } from './worker-type';
|
|
2
|
-
import { WorkerTypePatch } from './worker-type-type';
|
|
3
|
-
export declare class WorkerTypeMutation {
|
|
4
|
-
updateMultipleWorkerType(patches: WorkerTypePatch[], context: ResolverContext): Promise<WorkerType[]>;
|
|
5
|
-
deleteWorkerTypes(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
6
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkerTypeMutation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_graphql_1 = require("type-graphql");
|
|
6
|
-
const typeorm_1 = require("typeorm");
|
|
7
|
-
const worker_type_1 = require("./worker-type");
|
|
8
|
-
const worker_type_type_1 = require("./worker-type-type");
|
|
9
|
-
let WorkerTypeMutation = class WorkerTypeMutation {
|
|
10
|
-
async updateMultipleWorkerType(patches, context) {
|
|
11
|
-
const { domain, user, tx } = context.state;
|
|
12
|
-
let results = [];
|
|
13
|
-
const _createRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === '+');
|
|
14
|
-
const _updateRecords = patches.filter((patch) => patch.cuFlag.toUpperCase() === 'M');
|
|
15
|
-
const workerTypeRepo = tx.getRepository(worker_type_1.WorkerType);
|
|
16
|
-
if (_createRecords.length > 0) {
|
|
17
|
-
for (let i = 0; i < _createRecords.length; i++) {
|
|
18
|
-
const newRecord = _createRecords[i];
|
|
19
|
-
const result = await workerTypeRepo.save(Object.assign(Object.assign({}, newRecord), { domain, creator: user, updater: user }));
|
|
20
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: '+' }));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (_updateRecords.length > 0) {
|
|
24
|
-
for (let i = 0; i < _updateRecords.length; i++) {
|
|
25
|
-
const updateRecord = _updateRecords[i];
|
|
26
|
-
const workerType = await workerTypeRepo.findOneBy({ id: updateRecord.id });
|
|
27
|
-
const result = await workerTypeRepo.save(Object.assign(Object.assign(Object.assign({}, workerType), updateRecord), { updater: user }));
|
|
28
|
-
results.push(Object.assign(Object.assign({}, result), { cuFlag: 'M' }));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return results;
|
|
32
|
-
}
|
|
33
|
-
async deleteWorkerTypes(ids, context) {
|
|
34
|
-
const { domain, tx } = context.state;
|
|
35
|
-
await tx.getRepository(worker_type_1.WorkerType).softDelete({
|
|
36
|
-
domain: { id: domain.id },
|
|
37
|
-
id: (0, typeorm_1.In)(ids)
|
|
38
|
-
});
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.WorkerTypeMutation = WorkerTypeMutation;
|
|
43
|
-
tslib_1.__decorate([
|
|
44
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
45
|
-
(0, type_graphql_1.Mutation)(returns => [worker_type_1.WorkerType], { description: "To modify multiple WorkerTypes' information" }),
|
|
46
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [worker_type_type_1.WorkerTypePatch])),
|
|
47
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
48
|
-
tslib_1.__metadata("design:type", Function),
|
|
49
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
50
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
51
|
-
], WorkerTypeMutation.prototype, "updateMultipleWorkerType", null);
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
(0, type_graphql_1.Directive)('@transaction'),
|
|
54
|
-
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple WorkerTypes' }),
|
|
55
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
56
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
57
|
-
tslib_1.__metadata("design:type", Function),
|
|
58
|
-
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
59
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
60
|
-
], WorkerTypeMutation.prototype, "deleteWorkerTypes", null);
|
|
61
|
-
exports.WorkerTypeMutation = WorkerTypeMutation = tslib_1.__decorate([
|
|
62
|
-
(0, type_graphql_1.Resolver)(worker_type_1.WorkerType)
|
|
63
|
-
], WorkerTypeMutation);
|
|
64
|
-
//# sourceMappingURL=worker-type-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-type-mutation.js","sourceRoot":"","sources":["../../../server/service/worker-type/worker-type-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAC5B,+CAA0C;AAC1C,yDAAoD;AAG7C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,wBAAwB,CACe,OAA0B,EAC9D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAA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QAED,OAAO,OAAO,CAAA;IAChB,CAAC;IAIK,AAAN,KAAK,CAAC,iBAAiB,CAA+B,GAAa,EAAS,OAAwB;QAClG,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEpC,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,UAAU,CAAC;YAC5C,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE;YACzB,EAAE,EAAE,IAAA,YAAE,EAAC,GAAG,CAAC;SACZ,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AA3DY,gDAAkB;AAGvB;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;IAE/F,mBAAA,IAAA,kBAAG,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,kCAAe,CAAC,CAAC,CAAA;IACzC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;kEAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAS1E;6BA1DU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA2D9B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\nimport { WorkerType } from './worker-type'\nimport { WorkerTypePatch } from './worker-type-type'\n\n@Resolver(WorkerType)\nexport class WorkerTypeMutation {\n @Directive('@transaction')\n @Mutation(returns => [WorkerType], { description: \"To modify multiple WorkerTypes' information\" })\n async updateMultipleWorkerType(\n @Arg('patches', type => [WorkerTypePatch]) patches: WorkerTypePatch[],\n @Ctx() context: ResolverContext\n ): Promise<WorkerType[]> {\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 workerTypeRepo = tx.getRepository(WorkerType)\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 workerTypeRepo.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 workerType = await workerTypeRepo.findOneBy({ id: updateRecord.id })\n\n const result = await workerTypeRepo.save({\n ...workerType,\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 @Mutation(returns => Boolean, { description: 'To delete multiple WorkerTypes' })\n async deleteWorkerTypes(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(WorkerType).softDelete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Domain, ListParam } from '@things-factory/shell';
|
|
2
|
-
import { User } from '@things-factory/auth-base';
|
|
3
|
-
import { WorkerType } from './worker-type';
|
|
4
|
-
import { WorkerTypeList } from './worker-type-type';
|
|
5
|
-
export declare class WorkerTypeQuery {
|
|
6
|
-
workerType(id: string, context: ResolverContext): Promise<WorkerType>;
|
|
7
|
-
workerTypes(params: ListParam, context: ResolverContext): Promise<WorkerTypeList>;
|
|
8
|
-
domain(workerType: WorkerType): Promise<Domain>;
|
|
9
|
-
updater(workerType: WorkerType): Promise<User>;
|
|
10
|
-
creator(workerType: WorkerType): Promise<User>;
|
|
11
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkerTypeQuery = 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 worker_type_1 = require("./worker-type");
|
|
9
|
-
const worker_type_type_1 = require("./worker-type-type");
|
|
10
|
-
let WorkerTypeQuery = class WorkerTypeQuery {
|
|
11
|
-
async workerType(id, context) {
|
|
12
|
-
const { domain } = context.state;
|
|
13
|
-
return await (0, shell_1.getRepository)(worker_type_1.WorkerType).findOne({
|
|
14
|
-
where: { domain: { id: domain.id }, id }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
async workerTypes(params, context) {
|
|
18
|
-
const { domain } = context.state;
|
|
19
|
-
const queryBuilder = (0, shell_1.getQueryBuilderFromListParams)({
|
|
20
|
-
domain,
|
|
21
|
-
params,
|
|
22
|
-
repository: await (0, shell_1.getRepository)(worker_type_1.WorkerType)
|
|
23
|
-
});
|
|
24
|
-
const [items, total] = await queryBuilder.getManyAndCount();
|
|
25
|
-
return { items, total };
|
|
26
|
-
}
|
|
27
|
-
async domain(workerType) {
|
|
28
|
-
return await (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: workerType.domainId });
|
|
29
|
-
}
|
|
30
|
-
async updater(workerType) {
|
|
31
|
-
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: workerType.updaterId });
|
|
32
|
-
}
|
|
33
|
-
async creator(workerType) {
|
|
34
|
-
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: workerType.creatorId });
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.WorkerTypeQuery = WorkerTypeQuery;
|
|
38
|
-
tslib_1.__decorate([
|
|
39
|
-
(0, type_graphql_1.Query)(returns => worker_type_1.WorkerType, { nullable: true, description: 'To fetch a WorkerType' }),
|
|
40
|
-
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
41
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
42
|
-
tslib_1.__metadata("design:type", Function),
|
|
43
|
-
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
44
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
45
|
-
], WorkerTypeQuery.prototype, "workerType", null);
|
|
46
|
-
tslib_1.__decorate([
|
|
47
|
-
(0, type_graphql_1.Query)(returns => worker_type_type_1.WorkerTypeList, { description: 'To fetch multiple WorkerTypes' }),
|
|
48
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
49
|
-
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
50
|
-
tslib_1.__metadata("design:type", Function),
|
|
51
|
-
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
52
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
53
|
-
], WorkerTypeQuery.prototype, "workerTypes", null);
|
|
54
|
-
tslib_1.__decorate([
|
|
55
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
56
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
57
|
-
tslib_1.__metadata("design:type", Function),
|
|
58
|
-
tslib_1.__metadata("design:paramtypes", [worker_type_1.WorkerType]),
|
|
59
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
60
|
-
], WorkerTypeQuery.prototype, "domain", null);
|
|
61
|
-
tslib_1.__decorate([
|
|
62
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
63
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
64
|
-
tslib_1.__metadata("design:type", Function),
|
|
65
|
-
tslib_1.__metadata("design:paramtypes", [worker_type_1.WorkerType]),
|
|
66
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
67
|
-
], WorkerTypeQuery.prototype, "updater", null);
|
|
68
|
-
tslib_1.__decorate([
|
|
69
|
-
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User),
|
|
70
|
-
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
71
|
-
tslib_1.__metadata("design:type", Function),
|
|
72
|
-
tslib_1.__metadata("design:paramtypes", [worker_type_1.WorkerType]),
|
|
73
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
74
|
-
], WorkerTypeQuery.prototype, "creator", null);
|
|
75
|
-
exports.WorkerTypeQuery = WorkerTypeQuery = tslib_1.__decorate([
|
|
76
|
-
(0, type_graphql_1.Resolver)(worker_type_1.WorkerType)
|
|
77
|
-
], WorkerTypeQuery);
|
|
78
|
-
//# sourceMappingURL=worker-type-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-type-query.js","sourceRoot":"","sources":["../../../server/service/worker-type/worker-type-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AACnF,iDAAuG;AACvG,yDAAgD;AAChD,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAA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CAAC,iCAAc,EAAE,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAChE,mBAAA,IAAA,mBAAI,GAAE,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;kDAY1C;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;0BAtCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAuC3B","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx } from 'type-graphql'\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { WorkerType } from './worker-type'\nimport { WorkerTypeList } from './worker-type-type'\n\n@Resolver(WorkerType)\nexport class WorkerTypeQuery {\n @Query(returns => WorkerType!, { nullable: true, description: 'To fetch a WorkerType' })\n async workerType(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<WorkerType> {\n const { domain } = context.state\n\n return await getRepository(WorkerType).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => WorkerTypeList, { description: 'To fetch multiple WorkerTypes' })\n async workerTypes(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<WorkerTypeList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(WorkerType)\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() workerType: WorkerType): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: workerType.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() workerType: WorkerType): Promise<User> {\n return await getRepository(User).findOneBy({ id: workerType.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() workerType: WorkerType): Promise<User> {\n return await getRepository(User).findOneBy({ id: workerType.creatorId })\n }\n}\n"]}
|