feat: add emptyUnit bills table
feat: rework cash unit operations fix: multiple fixes for the empty unit workflow
This commit is contained in:
parent
797f074898
commit
45f722e724
8 changed files with 171 additions and 59 deletions
|
|
@ -4,28 +4,20 @@ const router = express.Router()
|
|||
|
||||
const emptyUnitUpdateCounts = (req, res, next) => {
|
||||
const deviceId = req.deviceId
|
||||
const newUnits = req.body.newUnits
|
||||
const { units: newUnits, fiatCode } = req.body
|
||||
|
||||
return emptyMachineUnits({ deviceId, cashUnits: newUnits })
|
||||
.then(() => res.sendStatus(200))
|
||||
.catch(e => {
|
||||
console.error(e)
|
||||
return res.sendStatus(500)
|
||||
})
|
||||
.finally(next)
|
||||
return emptyMachineUnits({ deviceId, newUnits: newUnits, fiatCode })
|
||||
.then(() => res.status(200).send({ status: 'OK' }))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
const refillUnitUpdateCounts = (req, res, next) => {
|
||||
const deviceId = req.deviceId
|
||||
const newUnits = req.body.newUnits
|
||||
|
||||
return refillMachineUnits({ deviceId, cashUnits: newUnits })
|
||||
.then(() => res.sendStatus(200))
|
||||
.catch(e => {
|
||||
console.error(e)
|
||||
return res.sendStatus(500)
|
||||
})
|
||||
.finally(next)
|
||||
return refillMachineUnits({ deviceId, newUnits: newUnits })
|
||||
.then(() => res.status(200).send({ status: 'OK' }))
|
||||
.catch(next)
|
||||
}
|
||||
|
||||
router.post('/empty', emptyUnitUpdateCounts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue