fix(machine): production hardware fixes for Douro cash-out
- Fix cassette denominations: Douro uses Q100/Q200, not Q20 - Add hal:get-inventory IPC so renderer can read HAL cassette inventory - Add balance fetch/display to HAL+IPC init path and idle screen - Enable/disable bill validator via watch on nested state transitions - Pass fiatCode to state machine context (was hardcoded to USD) - Preserve currency across state machine resetContext - Add CANCEL handler to dispenseError state (was stuck) - Fix remaining hardcoded $ symbols in CashInView Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c874d9e2e3
commit
0ea9640f49
9 changed files with 102 additions and 18 deletions
|
|
@ -214,6 +214,11 @@ ipcMain.handle('hal:reject-bill', () => {
|
|||
}
|
||||
})
|
||||
|
||||
ipcMain.handle('hal:get-inventory', () => {
|
||||
if (!halInstance) return {}
|
||||
return halInstance.getInventory()
|
||||
})
|
||||
|
||||
ipcMain.handle('hal:cleanup', async () => {
|
||||
if (halInstance) {
|
||||
await halInstance.cleanup()
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
halDisableValidator: (): Promise<void> => ipcRenderer.invoke('hal:disable-validator'),
|
||||
halStackBill: (): Promise<void> => ipcRenderer.invoke('hal:stack-bill'),
|
||||
halRejectBill: (): Promise<void> => ipcRenderer.invoke('hal:reject-bill'),
|
||||
halGetInventory: (): Promise<Record<number, number>> => ipcRenderer.invoke('hal:get-inventory'),
|
||||
halCleanup: (): Promise<void> => ipcRenderer.invoke('hal:cleanup'),
|
||||
|
||||
// HAL event listeners (main process → renderer)
|
||||
|
|
@ -106,6 +107,7 @@ declare global {
|
|||
halDisableValidator: () => Promise<void>
|
||||
halStackBill: () => Promise<void>
|
||||
halRejectBill: () => Promise<void>
|
||||
halGetInventory: () => Promise<Record<number, number>>
|
||||
halCleanup: () => Promise<void>
|
||||
onHalBillRead: (callback: (denomination: number) => void) => void
|
||||
onHalBillInserted: (callback: (denomination: number) => void) => void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue