fix: remove machine selector
This commit is contained in:
parent
30bc9c96da
commit
ee8c46b51e
8 changed files with 32 additions and 132 deletions
42
lib/sms.js
42
lib/sms.js
|
|
@ -5,22 +5,11 @@ const _ = require('lodash/fp')
|
|||
|
||||
const customSms = require('./custom-sms')
|
||||
|
||||
function getPhoneCodeSms (deviceId, phone, code) {
|
||||
return Promise.all([
|
||||
customSms.getCommonCustomMessages('sms_code'),
|
||||
customSms.getMachineCustomMessages('sms_code', deviceId)
|
||||
])
|
||||
.then(([commonMsg, machineMsg]) => {
|
||||
if (!_.isNil(machineMsg)) {
|
||||
const messageContent = _.replace('#code', code, machineMsg.message)
|
||||
return {
|
||||
toNumber: phone,
|
||||
body: messageContent
|
||||
}
|
||||
}
|
||||
|
||||
if (!_.isNil(commonMsg)) {
|
||||
const messageContent = _.replace('#code', code, commonMsg.message)
|
||||
function getPhoneCodeSms (phone, code) {
|
||||
return customSms.getCustomMessage('sms_code')
|
||||
.then(msg => {
|
||||
if (!_.isNil(msg)) {
|
||||
const messageContent = _.replace('#code', code, msg.message)
|
||||
return {
|
||||
toNumber: phone,
|
||||
body: messageContent
|
||||
|
|
@ -34,22 +23,11 @@ function getPhoneCodeSms (deviceId, phone, code) {
|
|||
})
|
||||
}
|
||||
|
||||
function getCashOutReadySms (deviceId, phone, timestamp) {
|
||||
return Promise.all([
|
||||
customSms.getCommonCustomMessages('cash_out_dispense_ready'),
|
||||
customSms.getMachineCustomMessages('cash_out_dispense_ready', deviceId)
|
||||
])
|
||||
.then(([commonMsg, machineMsg]) => {
|
||||
if (!_.isNil(machineMsg)) {
|
||||
const messageContent = _.replace('#timestamp', timestamp, machineMsg.message)
|
||||
return {
|
||||
toNumber: phone,
|
||||
body: messageContent
|
||||
}
|
||||
}
|
||||
|
||||
if (!_.isNil(commonMsg)) {
|
||||
const messageContent = _.replace('#timestamp', timestamp, commonMsg.message)
|
||||
function getCashOutReadySms (phone, timestamp) {
|
||||
return customSms.getCustomMessage('cash_out_dispense_ready')
|
||||
.then(msg => {
|
||||
if (!_.isNil(msg)) {
|
||||
const messageContent = _.replace('#timestamp', timestamp, msg.message)
|
||||
return {
|
||||
toNumber: phone,
|
||||
body: messageContent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue