refactor: cassete max capacity to constants file

This commit is contained in:
José Oliveira 2021-05-05 16:54:10 +01:00 committed by Josh Harvey
parent e3f57716fe
commit 75fa4e703c
2 changed files with 7 additions and 2 deletions

View file

@ -23,6 +23,8 @@ const coinUtils = require('./coin-utils')
const commissionMath = require('./commission-math')
const promoCodes = require('./promo-codes')
const { cassetteMaxCapacity } = require('./constants')
const notifier = require('./notifier')
const mapValuesWithKey = _.mapValues.convert({
@ -599,7 +601,7 @@ function plugins (settings, deviceId) {
}
: null
const cassette1Alert = cashOutEnabled && (device.cassette1 / 500) < notifications.fillingPercentageCassette1
const cassette1Alert = cashOutEnabled && (device.cassette1 / cassetteMaxCapacity) < notifications.fillingPercentageCassette1
? {
code: 'LOW_CASH_OUT',
cassette: 1,
@ -611,7 +613,7 @@ function plugins (settings, deviceId) {
}
: null
const cassette2Alert = cashOutEnabled && (device.cassette2 / 500) < notifications.fillingPercentageCassette2
const cassette2Alert = cashOutEnabled && (device.cassette2 / cassetteMaxCapacity) < notifications.fillingPercentageCassette2
? {
code: 'LOW_CASH_OUT',
cassette: 2,