feat: process triggers automation and add to poller response
This commit is contained in:
parent
24f85bb0cf
commit
2822acbda0
2 changed files with 23 additions and 1 deletions
|
|
@ -105,6 +105,25 @@ const getGlobalNotifications = config => getNotifications(null, null, config)
|
|||
|
||||
const getTriggers = _.get('triggers')
|
||||
|
||||
const getTriggersAutomation = config => {
|
||||
const defaultAutomation = _.get('triggersConfig_automation')(config)
|
||||
const requirements = {
|
||||
sms: defaultAutomation,
|
||||
idCardPhoto: defaultAutomation,
|
||||
idCardData: defaultAutomation,
|
||||
facephoto: defaultAutomation,
|
||||
usSsn: defaultAutomation
|
||||
}
|
||||
|
||||
const overrides = _.get('triggersConfig_overrides')(config)
|
||||
|
||||
const requirementsOverrides = _.reduce((acc, override) => {
|
||||
return _.assign(acc, { [override.requirement]: override.automation })
|
||||
}, {}, overrides)
|
||||
|
||||
return _.assign(requirements, requirementsOverrides)
|
||||
}
|
||||
|
||||
const splitGetFirst = _.compose(_.head, _.split('_'))
|
||||
|
||||
const getCryptosFromWalletNamespace = config => {
|
||||
|
|
@ -128,6 +147,7 @@ module.exports = {
|
|||
getTermsConditions,
|
||||
getAllCryptoCurrencies,
|
||||
getTriggers,
|
||||
getTriggersAutomation,
|
||||
getCashOut,
|
||||
getCryptosFromWalletNamespace
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue