fix: change coupons to promo codes
This commit is contained in:
parent
840afa866d
commit
59cb33570b
8 changed files with 87 additions and 88 deletions
|
|
@ -22,7 +22,7 @@ const machineLoader = require('./machine-loader')
|
|||
const customers = require('./customers')
|
||||
const coinUtils = require('./coin-utils')
|
||||
const commissionMath = require('./commission-math')
|
||||
const coupons = require('./coupons')
|
||||
const promoCodes = require('./promo-codes')
|
||||
|
||||
const mapValuesWithKey = _.mapValues.convert({
|
||||
cap: false
|
||||
|
|
@ -224,13 +224,13 @@ function plugins (settings, deviceId) {
|
|||
const testnetPromises = cryptoCodes.map(c => wallet.cryptoNetwork(settings, c))
|
||||
const pingPromise = recordPing(deviceTime, machineVersion, machineModel)
|
||||
const currentConfigVersionPromise = fetchCurrentConfigVersion()
|
||||
const currentAvailableCoupons = coupons.getNumberOfAvailableCoupons()
|
||||
const currentAvailablePromoCodes = promoCodes.getNumberOfAvailablePromoCodes()
|
||||
|
||||
const promises = [
|
||||
buildAvailableCassettes(),
|
||||
pingPromise,
|
||||
currentConfigVersionPromise
|
||||
].concat(tickerPromises, balancePromises, testnetPromises, currentAvailableCoupons)
|
||||
].concat(tickerPromises, balancePromises, testnetPromises, currentAvailablePromoCodes)
|
||||
|
||||
return Promise.all(promises)
|
||||
.then(arr => {
|
||||
|
|
@ -242,7 +242,7 @@ function plugins (settings, deviceId) {
|
|||
const testNets = arr.slice(2 * cryptoCodesCount + 3, arr.length - 1)
|
||||
const coinParams = _.zip(cryptoCodes, testNets)
|
||||
const coinsWithoutRate = _.map(mapCoinSettings, coinParams)
|
||||
const areThereAvailableCoupons = arr[arr.length - 1] > 0
|
||||
const areThereAvailablePromoCodes = arr[arr.length - 1] > 0
|
||||
|
||||
return {
|
||||
cassettes,
|
||||
|
|
@ -250,7 +250,7 @@ function plugins (settings, deviceId) {
|
|||
balances: buildBalances(balances),
|
||||
coins: _.zipWith(_.assign, coinsWithoutRate, tickers),
|
||||
configVersion,
|
||||
areThereAvailableCoupons
|
||||
areThereAvailablePromoCodes
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue