Skip to content

URD: Device

ModuleCORE-04Versionv0.1
StatusIn-progressDate2026-02-28

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. Functional Requirements

One table per functional area. <AREA> codes match the test-case IDs. Priority = MoSCoW (Must / Should / Could / Won't).

5.1 Device Registration & Management (DEV)

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

5.2 Mobile App (MOB)

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

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)

5.3 Web Application (WEB)

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

5.4 POS Terminal (POS)

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

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

5.5 Printer (PRN)

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

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

5.6 Barcode Scanner (SCN)

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

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)

5.7 SoundBox (SBX)

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

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

5.8 SoftPOS / NFC (NFC)

NFC contactless acceptance on Android via VNPAY; requires KYC. Planned

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

5.9 Device Identity & Health Monitoring (MON)

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)

6. Acceptance Criteria

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
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
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
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
AC-SBX-01: SoundBox Confirmation
GivenWhenThen
Paired SoundBoxPayment confirmedAmount + method announced in configured language
SoundBox disconnectedPayment confirmedPayment still succeeds; announcement silently skipped

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

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