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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ function poll (req, res, next) {
|
|||
const hasLightning = checkHasLightning(settings)
|
||||
|
||||
const triggers = configManager.getTriggers(settings.config)
|
||||
const triggersAutomation = configManager.getTriggersAutomation(settings.config)
|
||||
|
||||
const operatorInfo = configManager.getOperatorInfo(settings.config)
|
||||
const machineInfo = { deviceId: req.deviceId, deviceName: req.deviceName }
|
||||
|
|
@ -82,7 +83,8 @@ function poll (req, res, next) {
|
|||
receipt,
|
||||
operatorInfo,
|
||||
machineInfo,
|
||||
triggers
|
||||
triggers,
|
||||
triggersAutomation
|
||||
}
|
||||
|
||||
// BACKWARDS_COMPATIBILITY 7.5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue