@@ -16,7 +16,6 @@ const copilotPaymentService = require('./copilotPaymentService')
1616const timelineService = require ( './timelineService' )
1717const metadataService = require ( './metadataService' )
1818const paymentService = require ( './paymentService' )
19- const { parse } = require ( 'superagent' )
2019
2120/**
2221 * Drop and recreate phases in ifx
@@ -74,10 +73,12 @@ async function recreatePhases (legacyId, v5Phases, createdBy) {
7473async function syncChallengePhases ( legacyId , v5Phases ) {
7574 const phaseTypes = await timelineService . getPhaseTypes ( )
7675 const phasesFromIFx = await timelineService . getChallengePhases ( legacyId )
76+ logger . debug ( `Phases from v5: ${ JSON . stringify ( v5Phases ) } ` )
7777 logger . debug ( `Phases from IFX: ${ JSON . stringify ( phasesFromIFx ) } ` )
7878 for ( const phase of phasesFromIFx ) {
7979 const phaseName = _ . get ( _ . find ( phaseTypes , pt => pt . phase_type_id === phase . phase_type_id ) , 'name' )
8080 const v5Equivalent = _ . find ( v5Phases , p => p . name === phaseName )
81+ logger . info ( `Phase name: ${ phaseName } , v5 Equiv: ${ JSON . stringify ( v5Equivalent ) } ` )
8182 if ( v5Equivalent ) {
8283 // Compare duration and status
8384 if ( v5Equivalent . duration * 1000 !== phase . duration ) {
@@ -98,7 +99,11 @@ async function syncChallengePhases (legacyId, v5Phases) {
9899 phase . phase_status_id
99100 )
100101 // newStatus)
102+ } else {
103+ logger . info ( `Durations for ${ phaseName } match: ${ v5Equivalent . duration * 1000 } === ${ phase . duration } ` )
101104 }
105+ } else {
106+ logger . info ( `No v5 Equivalent Found for ${ phaseName } ` )
102107 }
103108 }
104109 // TODO: What about iterative reviews? There can be many for the same challenge.
@@ -653,7 +658,7 @@ async function processMessage (message) {
653658 try {
654659 metaValue = constants . supportedMetadata [ metadataKey ] . method ( message . payload , constants . supportedMetadata [ metadataKey ] . defaultValue )
655660 if ( metaValue !== null && metaValue !== '' ) {
656- logger . info ( `Setting ${ constants . supportedMetadata [ metadataKey ] . description } to ${ metaValue } ` )
661+ // logger.info(`Setting ${constants.supportedMetadata[metadataKey].description} to ${metaValue}`)
657662 await metadataService . createOrUpdateMetadata ( legacyId , metadataKey , metaValue , updatedByUserId )
658663 }
659664 } catch ( e ) {
0 commit comments