@@ -1141,6 +1141,8 @@ export default class ChangeRequestsService {
11411141 }
11421142 }
11431143
1144+ const isCreatingNewProject = projectProposedChanges && projectNumber === 0 ;
1145+
11441146 const changes = await prisma . wbs_Proposed_Changes . create ( {
11451147 data : {
11461148 scopeChangeRequest : {
@@ -1149,7 +1151,7 @@ export default class ChangeRequestsService {
11491151 }
11501152 } ,
11511153 name,
1152- status : wbsElement . status ,
1154+ status : isCreatingNewProject ? WBS_Element_Status . INACTIVE : wbsElement . status ,
11531155 links : {
11541156 create : validationResult . links . map ( ( linkInfo ) => ( {
11551157 url : linkInfo . url ,
@@ -1173,7 +1175,7 @@ export default class ChangeRequestsService {
11731175 wbsProposedChanges : {
11741176 create : {
11751177 name : workPackage . originalElement . name ,
1176- status : wbsElement . status ,
1178+ status : WBS_Element_Status . INACTIVE ,
11771179 proposedDescriptionBulletChanges : {
11781180 create : workPackage . descriptionBullets . map ( ( bullet ) => ( {
11791181 detail : bullet . detail ,
@@ -1232,11 +1234,13 @@ export default class ChangeRequestsService {
12321234 managerId
12331235 ) ;
12341236
1237+ const isCreatingNewWorkPackage = workPackageProposedChanges && workPackageNumber === 0 ;
1238+
12351239 const changes = await prisma . wbs_Proposed_Changes . create ( {
12361240 data : {
12371241 scopeChangeRequest : { connect : { scopeCrId : createdCR . scopeChangeRequest ! . scopeCrId } } ,
12381242 name,
1239- status : wbsElement . status ,
1243+ status : isCreatingNewWorkPackage ? WBS_Element_Status . INACTIVE : wbsElement . status ,
12401244 proposedDescriptionBulletChanges : {
12411245 create : validationResult . descriptionBullets . map ( ( bullet ) => ( {
12421246 detail : bullet . detail ,
0 commit comments