fix: getCashLimit wasn't returning actual value, cashLimit was assigned to an object instead of a number
This commit is contained in:
parent
f6a876ccb8
commit
95a1385a1e
2 changed files with 3 additions and 7 deletions
|
|
@ -64,7 +64,6 @@ function mapMachine (rates, settings, machineRow) {
|
|||
|
||||
const coinAtmRadar = configManager.getCoinAtmRadar(config)
|
||||
const triggers = configManager.getTriggers(config)
|
||||
const triggerCashLimit = complianceTriggers.getCashLimit(triggers)
|
||||
const locale = configManager.getLocale(deviceId, config)
|
||||
const cashOutConfig = configManager.getCashOut(deviceId, config)
|
||||
const cashOutEnabled = cashOutConfig.active ? cashOutConfig.active : false
|
||||
|
|
@ -72,12 +71,10 @@ function mapMachine (rates, settings, machineRow) {
|
|||
const lastOnline = machineRow.last_online.toISOString()
|
||||
const status = machineRow.stale ? 'online' : 'offline'
|
||||
const showLimitsAndVerification = coinAtmRadar.limitsAndVerification
|
||||
|
||||
const cashLimit = showLimitsAndVerification ? ( triggerCashLimit || Infinity ) : null
|
||||
const cashLimit = showLimitsAndVerification ? ( complianceTriggers.getCashLimit(triggers)?.threshold || Infinity ) : null
|
||||
const cryptoCurrencies = locale.cryptoCurrencies
|
||||
const identification = mapIdentification(config)
|
||||
const coins = _.map(_.partial(mapCoin, [rates, deviceId, settings]), cryptoCurrencies)
|
||||
|
||||
return {
|
||||
machineId: deviceId,
|
||||
address: {
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@ function maxDaysThreshold (triggers) {
|
|||
}
|
||||
|
||||
function getCashLimit (triggers) {
|
||||
const withFiat = _.filter(({ triggerType }) => _.includes(['txVolume', 'txAmount'])(triggerType))
|
||||
const blocking = _.filter(({ requirement }) => _.includes(['block', 'suspend'])(requirement))
|
||||
|
||||
const withFiat = _.filter(({ triggerType }) => _.includes(triggerType, ['txVolume', 'txAmount']))
|
||||
const blocking = _.filter(({ requirement }) => _.includes(requirement, ['block', 'suspend']))
|
||||
return _.compose(_.minBy('threshold'), blocking, withFiat)(triggers)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue