refactor: pull up variable to constants file
This commit is contained in:
parent
ed7c515993
commit
d759704db3
2 changed files with 9 additions and 4 deletions
|
|
@ -16,6 +16,9 @@ const USER_SESSIONS_CLEAR_INTERVAL = 1 * T.hour
|
|||
const AUTOMATIC = 'automatic'
|
||||
const MANUAL = 'manual'
|
||||
|
||||
const CASH_OUT_DISPENSE_READY = 'cash_out_dispense_ready'
|
||||
const CONFIRMATION_CODE = 'sms_code'
|
||||
|
||||
module.exports = {
|
||||
anonymousCustomer,
|
||||
cassetteMaxCapacity,
|
||||
|
|
@ -25,5 +28,7 @@ module.exports = {
|
|||
AUTOMATIC,
|
||||
MANUAL,
|
||||
USER_SESSIONS_TABLE_NAME,
|
||||
USER_SESSIONS_CLEAR_INTERVAL
|
||||
USER_SESSIONS_CLEAR_INTERVAL,
|
||||
CASH_OUT_DISPENSE_READY,
|
||||
CONFIRMATION_CODE
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const customers = require('./customers')
|
|||
const commissionMath = require('./commission-math')
|
||||
const loyalty = require('./loyalty')
|
||||
|
||||
const { cassetteMaxCapacity } = require('./constants')
|
||||
const { cassetteMaxCapacity, CASH_OUT_DISPENSE_READY, CONFIRMATION_CODE } = require('./constants')
|
||||
|
||||
const notifier = require('./notifier')
|
||||
|
||||
|
|
@ -361,7 +361,7 @@ function plugins (settings, deviceId) {
|
|||
|
||||
const phone = tx.phone
|
||||
const timestamp = dateFormat(new Date(), 'UTC:HH:MM Z')
|
||||
return sms.getSms('cash_out_dispense_ready', phone, { timestamp })
|
||||
return sms.getSms(CASH_OUT_DISPENSE_READY, phone, { timestamp })
|
||||
.then(smsObj => {
|
||||
const rec = {
|
||||
sms: smsObj
|
||||
|
|
@ -723,7 +723,7 @@ function plugins (settings, deviceId) {
|
|||
? '123'
|
||||
: randomCode()
|
||||
|
||||
return sms.getSms('sms_code', phone, { code })
|
||||
return sms.getSms(CONFIRMATION_CODE, phone, { code })
|
||||
.then(smsObj => {
|
||||
const rec = {
|
||||
sms: smsObj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue