Reintroduce cashbox (#535)

* feat: reintroduce cashbox component

* feat: cashbox update on db

* feat: cashbox on notifications

* feat: cashbox on overrides

* fix: cashin notifications

* fix: styling

* feat: cashin bills added to cashbox

* refactor: comment unused code

* fix: new bills length on cashbox

* fix: remove unused code

* chore: remove temporary code
This commit is contained in:
chaotixkilla 2021-01-18 20:23:46 +00:00 committed by GitHub
parent 0d3eb2e392
commit 26c5c427bf
6 changed files with 55 additions and 18 deletions

View file

@ -6,13 +6,13 @@ function getMachine (machineId) {
.then(machines => machines.find(({ deviceId }) => deviceId === machineId))
}
function machineAction ({ deviceId, action, cassette1, cassette2, newName }) {
function machineAction ({ deviceId, action, cashbox, cassette1, cassette2, newName }) {
return getMachine(deviceId)
.then(machine => {
if (!machine) throw new UserInputError(`machine:${deviceId} not found`, { deviceId })
return machine
})
.then(machineLoader.setMachine({ deviceId, action, cassettes: [cassette1, cassette2], newName }))
.then(machineLoader.setMachine({ deviceId, action, cashbox, cassettes: [cassette1, cassette2], newName }))
.then(getMachine(deviceId))
}