feat: TTLock encoder per workstation (Option A)

- Migration 051: add ttlock_com_port to workstations, drop com_port/workstation_id from hotel_ttlock_config
- Backend workstations PATCH: accepts ttlock_com_port alongside name
- Backend ttlock: test/issue-card use per-workstation com_port; auto-select online encoder if workstationId not specified
- TTLockPage Step 2: per-workstation table with COM port input, Save, Test buttons per row
- BookingDetailPanel: auto-issue if 1 encoder online, picker modal if multiple
- api.ts: TTLockConfig/Update cleaned up, Workstation gets ttlockComPort, issueCard/testEncoder updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-31 23:40:29 +03:00
parent 45697b56c3
commit f837a84db5
7 changed files with 263 additions and 175 deletions

View File

@@ -0,0 +1,9 @@
-- Move TTLock encoder COM port from global config to per-workstation
ALTER TABLE workstations
ADD COLUMN IF NOT EXISTS ttlock_com_port TEXT;
-- Remove workstation_id and com_port from global TTLock config
-- (com_port and workstation_id are now per-workstation)
ALTER TABLE hotel_ttlock_config
DROP COLUMN IF EXISTS workstation_id,
DROP COLUMN IF EXISTS com_port;