@@ -31,7 +31,9 @@ async function getGroup (v5GroupId, m2mToken) {
3131 * @param {String } m2mToken token for accessing the API
3232 */
3333async function getV5Terms ( v5TermsId , m2mToken ) {
34+ logger . debug ( `Get V5 Terms: ${ config . V5_TERMS_API_URL } /${ v5TermsId } ` )
3435 const response = await helper . getRequest ( `${ config . V5_TERMS_API_URL } /${ v5TermsId } ` , m2mToken )
36+ logger . debug ( `Get v5 terms response: ${ JSON . stringify ( response . body ) } ` )
3537 return response . body
3638}
3739
@@ -67,13 +69,20 @@ async function associateChallengeGroups (toBeAdded = [], toBeDeleted = [], legac
6769 * @param {String|Number } legacyChallengeId the legacy challenge ID
6870 */
6971async function associateChallengeTerms ( v5Terms , legacyChallengeId , createdBy , updatedBy ) {
72+ // logger.debug(`v5Terms Terms Array: ${JSON.stringify(v5Terms)}`)
7073 const legacyTermsArray = await termsService . getTermsForChallenge ( legacyChallengeId )
74+ // logger.debug(`Legacy Terms Array: ${JSON.stringify(legacyTermsArray)}`)
7175 const nda = _ . find ( v5Terms , e => e . id === config . V5_TERMS_NDA_ID )
7276 const legacyNDA = _ . find ( legacyTermsArray , e => _ . toNumber ( e . id ) === _ . toNumber ( config . LEGACY_TERMS_NDA_ID ) )
7377
7478 const standardTerms = _ . find ( v5Terms , e => e . id === config . V5_TERMS_STANDARD_ID )
7579 const legacyStandardTerms = _ . find ( legacyTermsArray , e => _ . toNumber ( e . id ) === _ . toNumber ( config . LEGACY_TERMS_STANDARD_ID ) )
7680
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+
7786 const m2mToken = await helper . getM2MToken ( )
7887 if ( standardTerms && standardTerms . id && ! legacyStandardTerms ) {
7988 logger . debug ( 'Associate Challenge Terms - v5 Standard Terms exist, not in legacy. Adding to Legacy.' )
0 commit comments