feat: route to get notified of machine cashbox removal

This commit is contained in:
André Sá 2021-11-12 10:19:47 +00:00
parent c396fb18fb
commit 6e2c9b3cbb

View file

@ -206,6 +206,15 @@ function stateChange (req, res, next) {
.catch(next)
}
function notifyCashboxRemoval (req, res, next) {
Promise.resolve()
.then(() => {
logger.log(`Device ${req.deviceId} had its cashbox removed.`)
return res.status(200).send({ status: 'OK' })
})
.catch(next)
}
function verifyUser (req, res, next) {
const pi = plugins(req.settings, req.deviceId)
pi.verifyUser(req.body)
@ -530,6 +539,7 @@ app.use(filterOldRequests)
app.get('/poll', poll)
app.get('/terms_conditions', getTermsConditions)
app.post('/state', stateChange)
app.post('/cashbox/removal', notifyCashboxRemoval)
app.post('/network/heartbeat', networkHeartbeat)
app.post('/network/performance', networkPerformance)