Skip to content

PRD: Device registration, identity, activation & peripherals

ModuleDevicePRD IDPRD-DEV-001
StatusNo itemFEATDEV
EpicPlaneBANA-1539
Date2026-07-21Versionv0.5
Packages@nx/commerceURDDEV
SurfaceClient · Owner/MgrSale · POSBO · Ops
OwnerDevice squad

What Device does

The back office has a device fleet page - list, create, edit - and device search scoped to the merchants the user has joined. Every device is pinned to exactly one required merchant, carries an auto-generated Device Identifier, and has an operational Status field with a five-step lifecycle. The device type catalog covers 8 types today, including a Cash Drawer registered and selected exactly like any other device.

What's newly settled in this revision: identity, the login check, and activation

Revision v0.3 left a question open: what exactly does "auto-register on first login" mean, and how does "automatic activation" actually work? This v0.4 revision settles that business logic into three explicit rules, replacing the previously vague description:

  1. One device, one durable identifier. The Device Identifier cannot live only in the app's local memory (lost on uninstall) - it must be durable across reinstalls on the same hardware.
  2. Login is check-first, create-second. The app calls an API asking "does this identifier already belong to the current merchant?" - if yes, it operates normally, nothing is created; if no, the system creates a new device, in status NEW.
  3. Activation is a discrete action. A NEW device does not automatically become ACTIVATED. The system generates an Activation Code in two forms - a QR (camera scan) and a Barcode (scanner/manual entry, serving cameraless devices) - and someone must scan/enter that exact code and press "Activate." Each code is usable exactly once. This mechanism is chosen to not depend on browser storage, so it still works when ITP (Intelligent Tracking Prevention - a policy that blocks cookies or scripts tracking behavior across different websites) limits client-side storage duration and makes the automatic check in step 2 unreliable.

These three rules are forward-spec - no code exists today for the check-API, code generation, or single-use activation; the current flow is just the client creating/reusing a deviceId stored in local session state, with no guaranteed durability across reinstall and no explicit activation step.

Cash Drawer is a real device type

Cash Drawer (500_CASH_DRAWER) is registered and searched through the exact same flow as a POS terminal - not a stub, and not merely the cashDrawerEnabled flag on a POS terminal (a separate, also-real mechanism; see the Device URD for the distinction). The previous PRD revision under-documented the device type catalog entirely - it also omits the 300_BROWSER type, auto-registered by web sessions.

Fleet health has no visibility today

Nothing tracks whether a device is physically broken, under repair, or has been liquidated. The schema already carries lastMaintenanceAt / nextMaintenanceAt / vendor fields (Built), but nothing computes a due/overdue flag from them, nothing notifies anyone, and there is no "Faulty" or "Liquidated" concept anywhere - an owner finds out a POS terminal is broken only when a cashier can't ring up a sale and calls to complain.

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.