chore: more usages of peer dependency
This commit is contained in:
parent
294db780b3
commit
241ce5ef54
3 changed files with 4 additions and 15 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
const _ = require('lodash/fp')
|
const _ = require('lodash/fp')
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
const pgp = require('pg-promise')()
|
const pgp = require('pg-promise')()
|
||||||
const dateFormat = require('dateformat')
|
|
||||||
const { getTimezoneOffset } = require('date-fns-tz')
|
const { getTimezoneOffset } = require('date-fns-tz')
|
||||||
const { millisecondsToMinutes } = require('date-fns/fp')
|
const { millisecondsToMinutes } = require('date-fns/fp')
|
||||||
|
|
||||||
|
|
@ -375,7 +374,8 @@ function plugins (settings, deviceId) {
|
||||||
logger.debug('notifyConfirmation')
|
logger.debug('notifyConfirmation')
|
||||||
|
|
||||||
const phone = tx.phone
|
const phone = tx.phone
|
||||||
const timestamp = dateFormat(new Date(), 'UTC:HH:MM Z')
|
|
||||||
|
const timestamp = `${(new Date()).toISOString().substring(11, 19)} UTC`
|
||||||
return sms.getSms(CASH_OUT_DISPENSE_READY, phone, { timestamp })
|
return sms.getSms(CASH_OUT_DISPENSE_READY, phone, { timestamp })
|
||||||
.then(smsObj => {
|
.then(smsObj => {
|
||||||
const rec = {
|
const rec = {
|
||||||
|
|
@ -767,13 +767,13 @@ function plugins (settings, deviceId) {
|
||||||
? '123'
|
? '123'
|
||||||
: randomCode()
|
: randomCode()
|
||||||
|
|
||||||
const timestamp = dateFormat(new Date(), 'UTC:HH:MM Z')
|
const timestamp = `${(new Date()).toISOString().substring(11, 19)} UTC`
|
||||||
return sms.getSms(CONFIRMATION_CODE, phone, { code, timestamp })
|
return sms.getSms(CONFIRMATION_CODE, phone, { code, timestamp })
|
||||||
.then(smsObj => {
|
.then(smsObj => {
|
||||||
const rec = {
|
const rec = {
|
||||||
sms: smsObj
|
sms: smsObj
|
||||||
}
|
}
|
||||||
|
|
||||||
return sms.sendMessage(settings, rec)
|
return sms.sendMessage(settings, rec)
|
||||||
.then(() => code)
|
.then(() => code)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,6 @@ function formatSmsReceipt (data, options) {
|
||||||
|
|
||||||
const timestamp = `${(new Date()).toISOString().substring(11, 19)} UTC`
|
const timestamp = `${(new Date()).toISOString().substring(11, 19)} UTC`
|
||||||
|
|
||||||
//`10:46:21 PM UTC`
|
|
||||||
|
|
||||||
const postReceiptSmsPromise = getSms(RECEIPT, data.customerPhone, { timestamp })
|
const postReceiptSmsPromise = getSms(RECEIPT, data.customerPhone, { timestamp })
|
||||||
|
|
||||||
return Promise.all([smsNotices.getSMSNotice(RECEIPT), postReceiptSmsPromise])
|
return Promise.all([smsNotices.getSMSNotice(RECEIPT), postReceiptSmsPromise])
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
const io = require('socket.io-client')
|
|
||||||
|
|
||||||
const socket = io('http://localhost:3060')
|
|
||||||
|
|
||||||
module.exports = {emit}
|
|
||||||
|
|
||||||
function emit (msg) {
|
|
||||||
socket.emit('message', msg)
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue