@@ -30,8 +30,8 @@ async function recreatePhases (legacyId, v5Phases, createdBy) {
3030 logger . debug ( 'Creating phases that exist on v5 and not on legacy...' )
3131 for ( const phase of v5Phases ) {
3232 const phaseLegacyId = _ . get ( _ . find ( phaseTypes , pt => pt . name === phase . name ) , 'phase_type_id' )
33- logger . debug ( `Phase ${ phase . name } has legacy phase type id ${ phaseLegacyId } ` )
3433 const existingLegacyPhase = _ . find ( phasesFromIFx , p => p . phase_type_id === phaseLegacyId )
34+ logger . debug ( `Phase ${ phase . name } has legacy phase type id ${ phaseLegacyId } - Existing Phase ${ JSON . stringify ( existingLegacyPhase ) } ` )
3535 if ( ! existingLegacyPhase && phaseLegacyId ) {
3636 const statusTypeId = phase . isOpen
3737 ? constants . PhaseStatusTypes . Open
@@ -67,7 +67,6 @@ async function recreatePhases (legacyId, v5Phases, createdBy) {
6767/**
6868 * Sync the information from the v5 phases into legacy
6969 * @param {Number } legacyId the legacy challenge ID
70- * @param {Array } v4Phases the v4 phases
7170 * @param {Array } v5Phases the v5 phases
7271 */
7372async function syncChallengePhases ( legacyId , v5Phases ) {
@@ -78,10 +77,10 @@ async function syncChallengePhases (legacyId, v5Phases) {
7877 for ( const phase of phasesFromIFx ) {
7978 const phaseName = _ . get ( _ . find ( phaseTypes , pt => pt . phase_type_id === phase . phase_type_id ) , 'name' )
8079 const v5Equivalent = _ . find ( v5Phases , p => p . name === phaseName )
81- logger . info ( `Phase name : ${ phaseName } , v5 Equiv: ${ JSON . stringify ( v5Equivalent ) } ` )
80+ logger . info ( `v4 Phase : ${ JSON . stringify ( phase ) } , v5 Equiv: ${ JSON . stringify ( v5Equivalent ) } ` )
8281 if ( v5Equivalent ) {
8382 // Compare duration and status
84- if ( v5Equivalent . duration * 1000 !== phase . duration ) {
83+ if ( v5Equivalent . duration * 1000 !== phase . duration * 1 ) {
8584 // ||
8685 // (v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Closed) ||
8786 // (!v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Open)) {
0 commit comments