Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 344213d

Browse files
follow v5 or time for phase.phase_status_id in legacy
1 parent 68ab030 commit 344213d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/services/ProcessorService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,16 @@ async function syncChallengePhases (legacyId, v5Phases, createdBy, isSelfService
9494
// : (new Date().getTime() <= new Date(v5Equivalent.scheduledEndDate).getTime() ? constants.PhaseStatusTypes.Scheduled : constants.PhaseStatusTypes.Closed)
9595
// update phase
9696
logger.debug(`Will update phase ${phaseName}/${v5Equivalent.name} from ${phase.duration} to duration ${v5Equivalent.duration * 1000} milli`)
97+
const newStatus = v5Equivalent.isOpen
98+
? constants.PhaseStatusTypes.Open
99+
: (new Date().getTime() <= new Date(v5Equivalent.scheduledEndDate).getTime() ? constants.PhaseStatusTypes.Scheduled : constants.PhaseStatusTypes.Closed)
97100
await timelineService.updatePhase(
98101
phase.project_phase_id,
99102
legacyId,
100103
v5Equivalent.scheduledStartDate,
101104
v5Equivalent.scheduledEndDate,
102105
v5Equivalent.duration * 1000,
103-
phase.phase_status_id
106+
newStatus // phase.phase_status_id
104107
)
105108
// newStatus)
106109
// } else {

0 commit comments

Comments
 (0)