diff --git a/lib/config-migration.js b/lib/config-migration.js index 2cffa11e..27eb1aea 100644 --- a/lib/config-migration.js +++ b/lib/config-migration.js @@ -163,17 +163,17 @@ function migrateCashOut (config) { return { ..._.fromPairs( - global.map(f => [`cashout_${globalCodes[f.code]}`, f.value]) + global.map(f => [`cashOut_${globalCodes[f.code]}`, f.value]) ), ..._.fromPairs( _.flatten( scoped.map(s => { const fields = s.values.map(f => [ - `cashout_${f.scope.machine}_${scopedCodes[f.code]}`, + `cashOut_${f.scope.machine}_${scopedCodes[f.code]}`, f.value ]) - fields.push([`cashout_${s.scope.machine}_id`, s.scope.machine]) + fields.push([`cashOut_${s.scope.machine}_id`, s.scope.machine]) return fields }) @@ -344,9 +344,9 @@ function migrateComplianceTriggers (config) { const requirements = { sms: 'sms', - idData: 'idData', - idPhoto: 'idPhoto', - facePhoto: 'facePhoto', + idData: 'idCardData', + idPhoto: 'idCardPhoto', + facePhoto: 'facephoto', sanctions: 'sanctions' } @@ -441,7 +441,10 @@ function migrateAccounts (accounts) { 'twilio' ] - return _.pick(accountArray)(accounts) + const services = _.keyBy('code', accounts) + const serviceFields = _.mapValues(service => _.keyBy('code', service.fields))(services) + const allAccounts = _.mapValues(_.mapValues(_.get('value')))(serviceFields) + return _.pick(accountArray)(allAccounts) } function migrate (config, accounts) {