Skip to content

URD: Device

ModuleCORE-04Versionv0.3
StatusIn-progressDate2026-06-15

Business documentation. This URD is Device's feature list - each feature below is one Functional Area (<AREA>). The same <AREA> keys the feature's PRDs (PRD-<AREA>-NNN) and tests (TC-<AREA>-NNN), and each feature is listed in the Delivery feature catalog. See the Feature Spine convention.

1. Purpose

This document defines user-facing requirements for Device management and hardware integration. It covers how an organization registers, manages, and monitors physical devices (POS terminals, mobile apps, web clients), and how the platform integrates peripherals (printers, barcode scanners, SoundBox, SoftPOS/NFC, external displays).

2. Scope

IncludedExcluded
Device registration, lifecycle, search, soft-deleteVNPAY Terminal backend wiring (table exists, API not connected - QE finding)
Hardware / software / maintenance infoLabel printer integration (Planned)
Device identity (machine UID, x-device-info header)Windows POS terminal (Planned)
Mobile, web, POS terminal apps + offline modeKitchen display, waiter, delivery apps (Planned)
Printer (USB/network, ESC/POS), scanner (HID/camera)Cash drawer control (Planned)
SoundBox, SoftPOS/NFC, external displayTechnical API specifications
Heartbeat / health monitoring, remote deactivationPayment gateway internals (see Payment URD)
CSV import/export; role-based access-

3. Definitions

TermDefinition
DeviceA registered hardware unit (POS terminal, mobile device, workstation) that interacts with the platform
Device IdentifierSystem-generated unique string D_YYYYMMDD_<snowflakeId> assigned at registration
Device CodeOptional human-readable code, unique within the organization
OrganizationTop-level owner of one or more merchants and devices
MerchantA business unit within an organization; a device may be optionally assigned to one
Hardware InfoManufacturer, model, serial number, IMEI, MAC, processor, RAM, storage, screen, battery
Software InfoOS, OS version, app version, firmware, last update, peripheral drivers
Device StatusLifecycle state: NEW → ACTIVATED → DEACTIVATED → SUSPENDED → ARCHIVED
HeartbeatPeriodic online ping (every 5 min); offline after 15 min of silence
Machine UIDHardware-derived identifier sent in the x-device-info HTTP header
ESC/POSThermal-printer command language; Vietnamese support via code page 28
HID Keyboard-WedgeUSB/Bluetooth scanner mode that emulates keyboard input
SoftPOSNFC contactless card acceptance on an Android phone, activated via VNPAY KYC
SoundBoxVNPAY Bluetooth speaker announcing payment confirmations
POS PointLogical sales station a device must be assigned to before processing sales

4. Conceptual Model

Conceptual only - full schema lives in the Commerce domain model.

5. Feature Catalog

The feature list of this module. Each row is one feature (a Functional Area). Detail in §6. Mirrored in the Delivery feature catalog.

Feature IDFeaturePhaseStatusPriority
DEVDevice Registration & ManagementP2In-progressHigh
MOBMobile AppP1BuiltHigh
WEBWeb ApplicationP1BuiltHigh
POSPOS TerminalP2In-progressHigh
PRNPrinterP2In-progressHigh
SCNBarcode ScannerP2In-progressHigh
SBXSoundBoxP1BuiltHigh
NFCSoftPOS / NFCP3PlannedHigh
DSXDevice Shift & Printer BindingP2BuiltHigh
MONDevice Identity & Health MonitoringP2In-progressHigh

Status: live from Plane where mapped, otherwise registry-declared. Vocabulary mirrors Plane (state-group / phase).

6. Features

One sub-section per feature, in catalog order. Each feature keeps its description, requirements, and acceptance together. Priority = MoSCoW (Must / Should / Could / Won't).

DEV - Device Registration & Management In-progress

Feature ID: device/DEV · Phase: P2 · PRDs: - · Dev: @nx/commerce

What it does for users: owners register each piece of hardware with an i18n name, type, and organization; move it through a status lifecycle; record hardware, software, and maintenance details; and search, import, and export their device fleet.

Requirements

IDPRequirement
URD-DEV-001MOwner can register a device with a name, type, and organization assignment
URD-DEV-002MSystem auto-generates a unique Device Identifier D_YYYYMMDD_<snowflakeId> at registration
URD-DEV-003MDevice name supports i18n (English + Vietnamese)
URD-DEV-004MDevice status follows the lifecycle NEW → ACTIVATED → DEACTIVATED → SUSPENDED → ARCHIVED; only valid transitions are permitted
URD-DEV-005MOwner can activate a registered device (NEW → ACTIVATED)
URD-DEV-006MOwner can deactivate (ACTIVATED → DEACTIVATED) and reactivate (DEACTIVATED → ACTIVATED) a device
URD-DEV-007MOwner can suspend a device (ACTIVATED → SUSPENDED) for a security concern
URD-DEV-008MOwner can archive a device (permanently read-only, hidden from POS)
URD-DEV-009MAll device records use soft-delete; records are never physically removed
URD-DEV-010MDevice API access requires authentication (JWT or Basic Auth)
URD-DEV-011MDevice code, when provided, must be unique within the organization
URD-DEV-012SOwner can record maintenance info (purchase date, warranty expiry, maintenance dates, notes)
URD-DEV-013MA device is auto-registered and activated on first app login; existing devices are reused
URD-DEV-014MOwner can search devices by name, identifier, code, status, and type
URD-DEV-015SOwner can import and export device records via CSV
URD-DEV-016MOwner can assign / unassign a device to a merchant; assignment is optional
URD-DEV-017SOwner can record hardware information for a device
URD-DEV-018SOwner can record software information for a device
URD-DEV-019SOwner can set a PIN on a device for local authentication

Device Statuses

StatusMeaning
NEWRegistered, not yet activated (default)
ACTIVATEDActive and authorized to process transactions
DEACTIVATEDTemporarily disabled; reactivatable
SUSPENDEDSuspended pending investigation; cannot transact
ARCHIVEDPermanently retired; read-only

Device Types

Type CodeLabel
100_POS_TERMINALPOS Terminal
101_POS_WORKSTATIONPOS Workstation
200_MOBILE_POSMobile POS
400_TABLETTablet
401_BARCODE_SCANNERBarcode Scanner Device
999_OTHEROther

Acceptance

AC-DEV-01: Registration
GivenWhenThen
OwnerRegisters a device with name + type + organizationDevice created with status NEW; unique identifier auto-generated
Code providedCode is unique within the organization

MOB - Mobile App Built

Feature ID: device/MOB · Phase: P1 · PRDs: - · Dev: sale-renderer

What it does for users: owners and cashiers run the POS, orders, payments, invoicing, and reporting on an iOS/Android app built with Tauri, with Bluetooth peripherals and offline capture that syncs on reconnect.

iOS/Android app built with Tauri; primary app for owners and cashiers.

Requirements

IDPRequirement
URD-MOB-001MApp is available on iOS 14+ and Android 8+
URD-MOB-002MOwner can sign in and access POS, orders, payments, invoicing, and reporting
URD-MOB-003MCashier can sign in and access the POS screen (owner-only screens restricted)
URD-MOB-004SApp supports Bluetooth peripheral connectivity (scanner, printer, SoundBox)
URD-MOB-005SApp supports offline mode: transactions captured locally and synced on reconnect
URD-MOB-006MLogin creates a device session linked to the device record (auto-register if new)

Acceptance

AC-MOB-01: Mobile sign-in & session
GivenWhenThen
Owner or cashier on iOS 14+ / Android 8+Signs in to the appA device session is created and linked to the device record (auto-registered if new)

WEB - Web Application Built

Feature ID: device/WEB · Phase: P1 · PRDs: - · Dev: client

What it does for users: owners run full back-office management - devices, products, orders, reports, settings - and a basic Web POS in modern browsers, over HTTPS with session expiry.

Requirements

IDPRequirement
URD-WEB-001MWeb app runs on modern browsers (Chrome, Edge, Firefox, Safari)
URD-WEB-002MWeb app provides full back-office management (devices, products, orders, reports, settings)
URD-WEB-003SWeb app supports a basic Web POS mode
URD-WEB-004MWeb app enforces HTTPS and session expiry/logout
URD-WEB-005SWeb app is usable at 1024px+ width; warns below the minimum

Acceptance

AC-WEB-01: Back-office access
GivenWhenThen
Owner on a modern browserSigns in over HTTPSFull back-office management is available; session expires/logs out per policy

POS - POS Terminal In-progress

Feature ID: device/POS · Phase: P2 · PRDs: - · Dev: sale-renderer

What it does for users: dedicated Android hardware runs the POS app full-screen with integrated peripherals; a device must be assigned to a POS Point and holds one active session before it can process sales.

Dedicated Android hardware running the POS app full-screen with integrated peripherals.

Requirements

IDPRequirement
URD-POS-001MPOS app runs on Android 8+ with ≥2 GB RAM and ≥16 GB storage
URD-POS-002MA device must be assigned to a POS Point before it can process sales; one active session per device
URD-POS-003MPOS app supports built-in peripherals (card reader, printer, scanner, cash drawer) where present
URD-POS-004SPOS app runs on certified hardware (VNPAY V-POS, Sunmi T2)
URD-POS-005MPOS app supports peripheral setup via Settings > Devices

Acceptance

AC-POS-01: POS Point assignment
GivenWhenThen
Activated device on Android 8+Assigned to a POS PointDevice can process sales with one active session at a time

PRN - Printer In-progress

Feature ID: device/PRN · Phase: P2 · PRDs: - · Dev: sale-main

What it does for users: the system prints ESC/POS receipts over USB and network thermal printers - text, images, QR, and barcodes - with Vietnamese code page 28, 58/80mm paper, auto-cut, and cash-drawer trigger.

USB (Tauri/WebUSB) and network (WebSocket) thermal printers; ESC/POS with Vietnamese code page 28.

Requirements

IDPRequirement
URD-PRN-001MSystem connects to printers over Bluetooth, USB, and network
URD-PRN-002MSystem detects USB printers by USB class code 0x07
URD-PRN-003MESC/POS engine prints text, embedded image, QR code, and barcode
URD-PRN-004MESC/POS markup supports alignment, bold, underline, font size, barcode, QR, image
URD-PRN-005MSystem rasterizes PDF content with Floyd-Steinberg dithering for thermal output
URD-PRN-006MVietnamese characters print correctly via code page 28
URD-PRN-007MSystem supports 58mm and 80mm paper widths, configurable per printer
URD-PRN-008SSystem supports auto-cut and a cash drawer triggered on print
URD-PRN-009SCash drawer trigger command is sent via the printer on cash payment
URD-PRN-010MPrint lifecycle (connect, disconnect, send job) surfaces a clear error on failure; no silent drop
URD-PRN-011SSystem connects to network printers via WebSocket and handles disconnection gracefully
URD-PRN-012MSystem falls back to WebUSB when the Tauri USB plugin is unavailable

Acceptance

AC-PRN-01: Receipt Printing
GivenWhenThen
Paired printerTransaction completedReceipt printed (auto or manual)
Print failsError shown with retry option
Vietnamese contentCode page 28 set automatically

SCN - Barcode Scanner In-progress

Feature ID: device/SCN · Phase: P2 · PRDs: - · Dev: sale-main

What it does for users: HID keyboard-wedge and mobile camera/QR scanning resolve against Product Identifiers - a successful scan on the POS screen adds the matched product to the cart.

HID keyboard-wedge (USB/Bluetooth) and mobile camera/QR scanning resolved against Product Identifiers.

Requirements

IDPRequirement
URD-SCN-001MSystem captures HID keyboard-wedge scanner input automatically (no pairing UI)
URD-SCN-002MScanner input must be 10-20 characters, completed within a 100ms keystroke timeout
URD-SCN-003MEnter key (or 100ms pause) triggers the scan and lookup
URD-SCN-004MCamera QR scanner is available on mobile via the Tauri barcode plugin
URD-SCN-005MOn a successful scan in the POS screen, the matched product is added to the cart
URD-SCN-006SSystem supports 1D (EAN-13/8, UPC-A/E, Code 128/39) and 2D (QR, Data Matrix) formats
URD-SCN-007SScanning works across multiple contexts (product search, invoice lookup)

Acceptance

AC-SCN-01: Barcode Scanning
GivenWhenThen
HID scannerScan a barcodeProduct looked up and added to cart
Camera scanner (mobile)Scan a QRProduct/invoice looked up
Unknown barcodeScanClear error message shown

SBX - SoundBox Built

Feature ID: device/SBX · Phase: P1 · PRDs: - · Dev: sale-renderer

What it does for users: a VNPAY Bluetooth speaker announces payment confirmations in Vietnamese/English - amount and method - per device, with configurable volume, LED status, and graceful disconnection.

VNPAY Bluetooth speaker announcing payment confirmations in Vietnamese/English, paired per device.

Requirements

IDPRequirement
URD-SBX-001MSystem pairs a VNPAY SoundBox (V1/V2) to a device via Bluetooth
URD-SBX-002MOn payment confirmation, system triggers a voice announcement; if disconnected, payment still succeeds (no blocking error)
URD-SBX-003MAnnouncement language follows configuration (Vietnamese / English), including amount and method
URD-SBX-004SSoundBox LED states reflect status: blue blinking (pairing), blue solid (connected), green (success), red (error/low battery)
URD-SBX-005SUser can configure volume (1-10) and toggle whether amount / method are announced
URD-SBX-006SSoundBox operates within its rated Bluetooth range (~10 m); beyond range, disconnection is handled gracefully

Acceptance

AC-SBX-01: SoundBox Confirmation
GivenWhenThen
Paired SoundBoxPayment confirmedAmount + method announced in configured language
SoundBox disconnectedPayment confirmedPayment still succeeds; announcement silently skipped

NFC - SoftPOS / NFC Planned

Feature ID: device/NFC · Phase: P3 · PRDs: - · Dev: sale-main

What it does for users: Android phones accept contactless card payments over NFC via VNPAY after KYC activation; the option is hidden on iOS and blocked when NFC is unavailable.

NFC contactless acceptance on Android via VNPAY; requires KYC.

Requirements

IDPRequirement
URD-NFC-001MSystem checks NFC hardware availability before enabling SoftPOS
URD-NFC-002MSoftPOS requires VNPAY KYC activation before first use
URD-NFC-003MSoftPOS activation is blocked when NFC is unavailable or disabled, with a clear message
URD-NFC-004SSoftPOS is Android-only; the option is hidden on iOS

Acceptance

AC-NFC-01: SoftPOS activation
GivenWhenThen
Android device with NFC available, KYC completedSoftPOS is activatedContactless card acceptance is enabled
NFC unavailable or disabledActivation attemptedActivation is blocked with a clear message

MON - Device Identity & Health Monitoring In-progress

Feature ID: device/MON · Phase: P2 · PRDs: - · Dev: @nx/commerce · @nx/signal

What it does for users: administrators see each device's online/offline status, last-seen time, and app version via a 5-minute heartbeat, and can remotely deactivate or wipe a compromised device.

Requirements

IDPRequirement
URD-MON-001MActive device sends a heartbeat every 5 minutes; platform records last activity
URD-MON-002MPlatform marks a device offline after 15 minutes without a heartbeat; back online on next ping
URD-MON-003MAdministrators can view device health (online/offline, last seen, app version) and filter by status
URD-MON-004MSystem can remotely deactivate a device and revoke its active session
URD-MON-005SSystem supports remote data wipe for a compromised device (queued if offline)

Acceptance

AC-MON-01: Health Monitoring
GivenWhenThen
Active deviceSends a heartbeatLast-activity timestamp updated
No heartbeat for 15 minDevice marked offline
Admin views device listOnline/offline status visible

DSX - Device Shift & Printer Binding Built

Feature ID: device/DSX · Phase: P2 · PRDs: PRD-DSX-001 · Dev: @nx/sale · @nx/commerce

What it does for users: the registered device becomes the runtime anchor of a sales station - the x-device-info header resolves every shift action to a device and derives its merchant, a single shift is opened or joined per sale channel, cash-drawer-enabled devices get a per-device drawer, the current context reports device participation, X/Z reports key on the device, and each station binds to its own printer.

Requirements

IDPRequirement
URD-DSX-001MEvery device-scoped shift action resolves its device from the x-device-info header; the merchant is derived from that device record, never supplied by the client
URD-DSX-002MA missing x-device-info header on a device-scoped action is rejected with a clear error; back-office reads (e.g. shift list) may run without a device using the active-merchant scope
URD-DSX-003MThe device must exist, be assigned to a merchant, and (when a merchant is also supplied) match it; otherwise the action is rejected
URD-DSX-004MTenant access is enforced on the resolved merchant for every shift action
URD-DSX-005MOpening a shift opens or joins the single open shift for the device's sale channel; a concurrent open by another device joins the same shift rather than creating a duplicate
URD-DSX-006MA sale channel supplied on open must belong to the resolved merchant
URD-DSX-007MThe opening/joining device is enrolled in the shift, and the opening employee is checked in alongside it
URD-DSX-008SA per-device cash drawer is created on open only for cash-drawer-enabled devices; other devices join without a drawer
URD-DSX-009MThe current-context endpoint returns the device's shift, its enrollment, optional drawer, expected cash, and device participation (active count, joined count, pending devices)
URD-DSX-010MExpected cash is omitted from the context when the merchant's blind-count policy is enabled or there is no drawer
URD-DSX-011MX (mid-shift) and Z (end-of-shift) reports can be generated per device and per shift, keyed on the resolved device
URD-DSX-012MA device is registered against a merchant; the device record is the merchant-scoped anchor every shift, drawer, and report binds to
URD-DSX-013MDevice API access is merchant-scoped and authenticated (JWT or Basic Auth); device search is limited to the merchants the signed-in user has joined
URD-DSX-014MA device declares whether it drives a cash drawer; the flag governs drawer creation at shift open
URD-DSX-015SA print destination is bound per kitchen station (printer, copy count, auto-print); print jobs route to the bound printer

Acceptance

AC-DSX-01: Device-scoped shift resolution
GivenWhenThen
Registered device, x-device-info header presentA shift action is calledThe device is resolved, the merchant is derived from it, and tenant access is enforced
Header missing on a device-scoped actionThe action is calledRejected with a clear error
Device assigned to another merchantThe action is calledRejected - merchant mismatch / forbidden
AC-DSX-02: Open or join one shift per channel
GivenWhenThen
No open shift for the channelA device opens a shiftA new open shift is created and the device is enrolled
An open shift exists for the channelAnother device opensIt joins the same shift; no duplicate is created
Two devices open the same channel concurrentlyBoth openThey converge on one shift
AC-DSX-03: Drawer & participation
GivenWhenThen
Cash-drawer-enabled deviceOpens a shiftA per-device drawer is created with the opening float
Drawer-less deviceOpens / joins a shiftIt joins without a drawer
Merchant blind-count enabledCurrent context is readExpected cash is omitted; participation still returned
AC-DSX-04: Printer binding
GivenWhenThen
A kitchen station bound to a printer (printer, copies, auto-print)A print job is produced for that stationThe job routes to the bound printer with the configured copies

7. Constraints & Non-Goals

Constraints

IDConstraint
C-01All devices must be registered before they can operate
C-02A device must be assigned to a POS Point before processing sales
C-03Only one active session is permitted per device at a time
C-04Device Identifiers are auto-generated and immutable
C-05Device codes must be unique within the organization
C-06All device records use soft-delete
C-07Status transitions follow the defined lifecycle; invalid transitions are rejected
C-08SoftPOS is Android-only and requires VNPAY KYC
C-09Each POS should have exactly one default printer
C-10Maximum devices per organization is configurable by the operator
C-11Heartbeat is every 5 min; offline threshold is 15 min
C-12HID scanner input must be 10-20 chars within a 100ms timeout
C-13USB printer code page 28 (Vietnamese) is set automatically on connection

Non-Goals

  • VNPAY Terminal backend API wiring (table exists, no backend connected - QE finding)
  • Label printer integration; Windows POS terminal support
  • Kitchen display, waiter/service, delivery, and inventory specialized apps
  • Cash drawer control; advanced peripheral driver management UI
  • Technical API specifications and payment-gateway integration details

8. Version History

DateAuthorDescriptionVer
2026-02-28Q. Do - QEInitial URD from code-level and documentation analysisv0.1
2026-06-04Claude (AI pair)Reorganize by feature (Feature Spine)v0.2
2026-06-15Sale squadAdd DSX - Device Shift & Printer Binding (Built)v0.3

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