PRD: Device shift context & printer binding
| Module | Device | PRD ID | PRD-DSX-001 |
| Status | Ready to dev | FEAT | DSX |
| Epic | — | Plane | BANA-1538 |
| Date | 2026-07-17 | Version | v1.1 |
| Packages | @nx/sale · @nx/commerce · @nx/core | URD | DSX |
| Surface | Sale · POSClient · Owner/Mgr | ||
| Owner | Phát Nguyễn | ||
The device is the runtime anchor of a sales station
Makes the registered device the runtime anchor of a sales station. Every shift action carries the device identity; the platform resolves that device, derives the merchant from the device record (never from a client-supplied value), and asserts tenant access before anything runs. Opening a shift opens or joins the single open shift for the device's sale channel - concurrent opens converge on one shift, never a duplicate. A cash drawer is created only for cash-drawer-enabled devices, and the current-context call reports who is participating (active, joined, pending) plus expected cash - unless blind-count is on. Print jobs route to the printer bound per kitchen station. Net result: a device is registered once against a merchant, and shifts, drawers, reports, and receipts all bind to that single anchor.
The problem this increment closes
A merchant runs several physical stations - POS terminals, mobile apps, a back counter - all under one merchant. The device registration increment (PRD-DEV-001) gives each station a record and a stable identity, but it does not define how that record becomes the operational anchor a shift, a cash drawer, a report, and a printer all hang off.
Without that anchor, a client would have to tell the server which merchant and which shift it is acting in - so two terminals could open two shifts for the same channel, a cash drawer could be created for a device that has no drawer, and a print job would have nowhere to route. Trusting a client-supplied merchant also breaks tenant isolation.
This increment closes the gap: the device identity resolves every shift action to a device, the merchant is derived from the device record, the channel's shift is opened or joined (never duplicated), drawers and participation track per device, and a print destination is bound per station. The station's identity, set at registration, now governs its whole runtime.