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

Commit 284a77f

Browse files
always overwrite dates from v5
1 parent 699f2aa commit 284a77f

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/services/ProcessorService.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,27 +84,27 @@ async function syncChallengePhases (legacyId, v5Phases, createdBy, isSelfService
8484
logger.info(`v4 Phase: ${JSON.stringify(phase)}, v5 Equiv: ${JSON.stringify(v5Equivalent)}`)
8585
if (v5Equivalent) {
8686
// Compare duration and status
87-
if (v5Equivalent.duration * 1000 !== phase.duration * 1 || isSelfService) {
88-
// ||
89-
// (v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Closed) ||
90-
// (!v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Open)) {
91-
// const newStatus = v5Equivalent.isOpen
92-
// ? constants.PhaseStatusTypes.Open
93-
// : (new Date().getTime() <= new Date(v5Equivalent.scheduledEndDate).getTime() ? constants.PhaseStatusTypes.Scheduled : constants.PhaseStatusTypes.Closed)
94-
// update phase
95-
logger.debug(`Will update phase ${phaseName}/${v5Equivalent.name} from ${phase.duration} to duration ${v5Equivalent.duration * 1000} milli`)
96-
await timelineService.updatePhase(
97-
phase.project_phase_id,
98-
legacyId,
99-
v5Equivalent.scheduledStartDate,
100-
v5Equivalent.scheduledEndDate,
101-
v5Equivalent.duration * 1000,
102-
phase.phase_status_id
103-
)
104-
// newStatus)
105-
} else {
106-
logger.info(`Durations for ${phaseName} match: ${v5Equivalent.duration * 1000} === ${phase.duration}`)
107-
}
87+
// if (v5Equivalent.duration * 1000 !== phase.duration * 1 || isSelfService) {
88+
// ||
89+
// (v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Closed) ||
90+
// (!v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Open)) {
91+
// const newStatus = v5Equivalent.isOpen
92+
// ? constants.PhaseStatusTypes.Open
93+
// : (new Date().getTime() <= new Date(v5Equivalent.scheduledEndDate).getTime() ? constants.PhaseStatusTypes.Scheduled : constants.PhaseStatusTypes.Closed)
94+
// update phase
95+
logger.debug(`Will update phase ${phaseName}/${v5Equivalent.name} from ${phase.duration} to duration ${v5Equivalent.duration * 1000} milli`)
96+
await timelineService.updatePhase(
97+
phase.project_phase_id,
98+
legacyId,
99+
v5Equivalent.scheduledStartDate,
100+
v5Equivalent.scheduledEndDate,
101+
v5Equivalent.duration * 1000,
102+
phase.phase_status_id
103+
)
104+
// newStatus)
105+
// } else {
106+
// logger.info(`Durations for ${phaseName} match: ${v5Equivalent.duration * 1000} === ${phase.duration}`)
107+
// }
108108
} else {
109109
logger.info(`No v5 Equivalent Found for ${phaseName}`)
110110
}

0 commit comments

Comments
 (0)