fix: migrate accounts, cashout settings, and some triggers
This commit is contained in:
parent
6e64a341de
commit
5b81194fc3
1 changed files with 10 additions and 7 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue