@@ -16,7 +16,6 @@ const copilotPaymentService = require('./copilotPaymentService')
16
16
const timelineService = require ( './timelineService' )
17
17
const metadataService = require ( './metadataService' )
18
18
const paymentService = require ( './paymentService' )
19
- const { parse } = require ( 'superagent' )
20
19
21
20
/**
22
21
* Drop and recreate phases in ifx
@@ -74,10 +73,12 @@ async function recreatePhases (legacyId, v5Phases, createdBy) {
74
73
async function syncChallengePhases ( legacyId , v5Phases ) {
75
74
const phaseTypes = await timelineService . getPhaseTypes ( )
76
75
const phasesFromIFx = await timelineService . getChallengePhases ( legacyId )
76
+ logger . debug ( `Phases from v5: ${ JSON . stringify ( v5Phases ) } ` )
77
77
logger . debug ( `Phases from IFX: ${ JSON . stringify ( phasesFromIFx ) } ` )
78
78
for ( const phase of phasesFromIFx ) {
79
79
const phaseName = _ . get ( _ . find ( phaseTypes , pt => pt . phase_type_id === phase . phase_type_id ) , 'name' )
80
80
const v5Equivalent = _ . find ( v5Phases , p => p . name === phaseName )
81
+ logger . info ( `Phase name: ${ phaseName } , v5 Equiv: ${ JSON . stringify ( v5Equivalent ) } ` )
81
82
if ( v5Equivalent ) {
82
83
// Compare duration and status
83
84
if ( v5Equivalent . duration * 1000 !== phase . duration ) {
@@ -98,7 +99,11 @@ async function syncChallengePhases (legacyId, v5Phases) {
98
99
phase . phase_status_id
99
100
)
100
101
// newStatus)
102
+ } else {
103
+ logger . info ( `Durations for ${ phaseName } match: ${ v5Equivalent . duration * 1000 } === ${ phase . duration } ` )
101
104
}
105
+ } else {
106
+ logger . info ( `No v5 Equivalent Found for ${ phaseName } ` )
102
107
}
103
108
}
104
109
// TODO: What about iterative reviews? There can be many for the same challenge.
@@ -653,7 +658,7 @@ async function processMessage (message) {
653
658
try {
654
659
metaValue = constants . supportedMetadata [ metadataKey ] . method ( message . payload , constants . supportedMetadata [ metadataKey ] . defaultValue )
655
660
if ( metaValue !== null && metaValue !== '' ) {
656
- logger . info ( `Setting ${ constants . supportedMetadata [ metadataKey ] . description } to ${ metaValue } ` )
661
+ // logger.info(`Setting ${constants.supportedMetadata[metadataKey].description} to ${metaValue}`)
657
662
await metadataService . createOrUpdateMetadata ( legacyId , metadataKey , metaValue , updatedByUserId )
658
663
}
659
664
} catch ( e ) {
0 commit comments