@dssp/supervision 0.0.25 → 0.0.26
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/client/pages/building-inspection/building-inspection-list.ts +26 -11
- package/dist-client/pages/building-inspection/building-inspection-list.d.ts +2 -0
- package/dist-client/pages/building-inspection/building-inspection-list.js +26 -10
- package/dist-client/pages/building-inspection/building-inspection-list.js.map +1 -1
- package/dist-client/pages/checklist/checklist-view.js +2 -0
- package/dist-client/pages/checklist/checklist-view.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/building-inspection/building-inspection-mutation.js +36 -12
- package/dist-server/service/building-inspection/building-inspection-mutation.js.map +1 -1
- package/dist-server/service/index.d.ts +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/building-inspection/building-inspection-mutation.ts +37 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dssp/supervision",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@dssp/building-complex": "^0.0.
|
|
31
|
-
"@dssp/project": "^0.0.
|
|
30
|
+
"@dssp/building-complex": "^0.0.26",
|
|
31
|
+
"@dssp/project": "^0.0.26",
|
|
32
32
|
"@operato/event-view": "^8.0.0-alpha",
|
|
33
33
|
"@operato/graphql": "^8.0.0-alpha",
|
|
34
34
|
"@operato/image-marker": "^8.0.0-alpha",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"@things-factory/auth-base": "^8.0.0-alpha",
|
|
38
38
|
"@things-factory/shell": "^8.0.0-alpha"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "240bdb67cf79bb5d922fc082db3d84f6e3cc488c"
|
|
41
41
|
}
|
|
@@ -84,7 +84,10 @@ export class BuildingInspectionMutation {
|
|
|
84
84
|
const checklistItemRepo = tx.getRepository(ChecklistItem)
|
|
85
85
|
const oldBuildingInspection = await buildingInspectionRepo.findOneBy({ id: buildingInspectionId })
|
|
86
86
|
const status = oldBuildingInspection.status
|
|
87
|
-
const isConstructor: boolean =
|
|
87
|
+
const isConstructor: boolean =
|
|
88
|
+
status == BuildingInspectionStatus.WAIT ||
|
|
89
|
+
status == BuildingInspectionStatus.OVERALL_WAIT ||
|
|
90
|
+
status == BuildingInspectionStatus.FAIL
|
|
88
91
|
let inspectionStatus = null
|
|
89
92
|
|
|
90
93
|
// 1. 벨리데이션
|
|
@@ -97,14 +100,27 @@ export class BuildingInspectionMutation {
|
|
|
97
100
|
if (checklistItem.length !== checklistItem.filter(v => v.constructionConfirmStatus).length) {
|
|
98
101
|
throw new Error('아이템을 모두 체크해야 합니다.')
|
|
99
102
|
}
|
|
100
|
-
if (!checklist.overallConstructorSignature)
|
|
101
|
-
|
|
103
|
+
if (status == BuildingInspectionStatus.OVERALL_WAIT && !checklist.overallConstructorSignature) {
|
|
104
|
+
throw new Error('총괄 시공책임자 사인이 없습니다.')
|
|
105
|
+
}
|
|
106
|
+
if (status == BuildingInspectionStatus.WAIT && !checklist.taskConstructorSignature) {
|
|
107
|
+
throw new Error('공종별 시공관리자 사인이 없습니다.')
|
|
108
|
+
}
|
|
102
109
|
|
|
103
110
|
// 시공자 상태 데이터
|
|
104
111
|
const isPassed = checklistItem.length === checklistItem.filter(v => v.constructionConfirmStatus === 'T').length
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
|
|
113
|
+
if (!isPassed) {
|
|
114
|
+
// 1. 검측이 불햡격 = 상태는 불합격으로, 시공자 싸인은 모두 초기화
|
|
115
|
+
inspectionStatus = BuildingInspectionStatus.FAIL
|
|
116
|
+
checklist.overallConstructorSignature = null
|
|
117
|
+
checklist.taskConstructorSignature = null
|
|
118
|
+
} else if (isPassed && (status === BuildingInspectionStatus.WAIT || status === BuildingInspectionStatus.FAIL)) {
|
|
119
|
+
// 2. 검측이 합격이면서 공종 시공자 스탭 = 상태는 총괄 시공자 스탭으로
|
|
120
|
+
inspectionStatus = BuildingInspectionStatus.OVERALL_WAIT
|
|
121
|
+
} else if (isPassed && status === BuildingInspectionStatus.OVERALL_WAIT) {
|
|
122
|
+
// 3. 검측이 합격이면서 총괄 시공자 스탭 = 상태는 공종 감리자 스탭으로, 감리자 싸인은 모두 초기화
|
|
123
|
+
inspectionStatus = BuildingInspectionStatus.REQUEST
|
|
108
124
|
checklist.overallSupervisorySignature = null
|
|
109
125
|
checklist.taskSupervisorySignature = null
|
|
110
126
|
}
|
|
@@ -113,16 +129,26 @@ export class BuildingInspectionMutation {
|
|
|
113
129
|
if (checklistItem.length !== checklistItem.filter(v => v.supervisoryConfirmStatus).length) {
|
|
114
130
|
throw new Error('아이템을 모두 체크해야 합니다.')
|
|
115
131
|
}
|
|
116
|
-
if (!checklist.overallSupervisorySignature)
|
|
117
|
-
|
|
132
|
+
if (status == BuildingInspectionStatus.OVERALL_REQUEST && !checklist.overallSupervisorySignature) {
|
|
133
|
+
throw new Error('총괄 감리책임자 사인이 없습니다.')
|
|
134
|
+
}
|
|
135
|
+
if (status == BuildingInspectionStatus.REQUEST && !checklist.taskSupervisorySignature) {
|
|
136
|
+
throw new Error('공종별 감리 책임자 사인이 없습니다.')
|
|
137
|
+
}
|
|
118
138
|
|
|
119
139
|
// 감리자 상태 데이터
|
|
120
140
|
const isPassed = checklistItem.length === checklistItem.filter(v => v.supervisoryConfirmStatus === 'T').length
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
if (!isPassed) {
|
|
142
|
+
// 1. 검측이 불햡격 = 상태는 불합격으로, 시공자 싸인은 모두 초기화
|
|
143
|
+
inspectionStatus = BuildingInspectionStatus.FAIL
|
|
124
144
|
checklist.overallConstructorSignature = null
|
|
125
145
|
checklist.taskConstructorSignature = null
|
|
146
|
+
} else if (isPassed && status === BuildingInspectionStatus.REQUEST) {
|
|
147
|
+
// 2. 검측이 합격이면서 공종 감리자 스탭 = 상태는 총괄 감리자 스탭으로
|
|
148
|
+
inspectionStatus = BuildingInspectionStatus.OVERALL_REQUEST
|
|
149
|
+
} else if (isPassed && status === BuildingInspectionStatus.OVERALL_REQUEST) {
|
|
150
|
+
// 3. 검측이 합격이면서 총괄 감리자 스탭 = 상태는 합격으로
|
|
151
|
+
inspectionStatus = BuildingInspectionStatus.PASS
|
|
126
152
|
}
|
|
127
153
|
}
|
|
128
154
|
|