@@ -31,7 +31,9 @@ async function getGroup (v5GroupId, m2mToken) {
31
31
* @param {String } m2mToken token for accessing the API
32
32
*/
33
33
async function getV5Terms ( v5TermsId , m2mToken ) {
34
+ logger . debug ( `Get V5 Terms: ${ config . V5_TERMS_API_URL } /${ v5TermsId } ` )
34
35
const response = await helper . getRequest ( `${ config . V5_TERMS_API_URL } /${ v5TermsId } ` , m2mToken )
36
+ logger . debug ( `Get v5 terms response: ${ JSON . stringify ( response . body ) } ` )
35
37
return response . body
36
38
}
37
39
@@ -67,13 +69,20 @@ async function associateChallengeGroups (toBeAdded = [], toBeDeleted = [], legac
67
69
* @param {String|Number } legacyChallengeId the legacy challenge ID
68
70
*/
69
71
async function associateChallengeTerms ( v5Terms , legacyChallengeId , createdBy , updatedBy ) {
72
+ // logger.debug(`v5Terms Terms Array: ${JSON.stringify(v5Terms)}`)
70
73
const legacyTermsArray = await termsService . getTermsForChallenge ( legacyChallengeId )
74
+ // logger.debug(`Legacy Terms Array: ${JSON.stringify(legacyTermsArray)}`)
71
75
const nda = _ . find ( v5Terms , e => e . id === config . V5_TERMS_NDA_ID )
72
76
const legacyNDA = _ . find ( legacyTermsArray , e => _ . toNumber ( e . id ) === _ . toNumber ( config . LEGACY_TERMS_NDA_ID ) )
73
77
74
78
const standardTerms = _ . find ( v5Terms , e => e . id === config . V5_TERMS_STANDARD_ID )
75
79
const legacyStandardTerms = _ . find ( legacyTermsArray , e => _ . toNumber ( e . id ) === _ . toNumber ( config . LEGACY_TERMS_STANDARD_ID ) )
76
80
81
+ // logger.debug(`NDA: ${config.V5_TERMS_NDA_ID} - ${JSON.stringify(nda)}`)
82
+ // logger.debug(`Standard Terms: ${config.V5_TERMS_STANDARD_ID} - ${JSON.stringify(standardTerms)}`)
83
+ // logger.debug(`Legacy NDA: ${JSON.stringify(legacyNDA)}`)
84
+ // logger.debug(`Legacy Standard Terms: ${JSON.stringify(legacyStandardTerms)}`)
85
+
77
86
const m2mToken = await helper . getM2MToken ( )
78
87
if ( standardTerms && standardTerms . id && ! legacyStandardTerms ) {
79
88
logger . debug ( 'Associate Challenge Terms - v5 Standard Terms exist, not in legacy. Adding to Legacy.' )
0 commit comments