feat: TTLock integration + fix agent offline status

- Add TTLock electronic lock module: settings page, room-lock mapping,
  card issuance via agent command (ttlock:write_card)
- Fix agent offline: EquipmentPage now polls every 30s + reacts to
  workstation:online/offline WebSocket events instantly
- Backend broadcasts workstation online/offline events to hotel clients
  via existing WebSocket (agent-ws.ts)
- New DB migration 048_ttlock.sql: hotel_ttlock_config, room_lock_mappings,
  card_issuances tables
- New backend routes: GET/PATCH ttlock/config, POST ttlock/token,
  GET ttlock/locks, POST/DELETE ttlock/room-locks, POST issue-card
- "Выдать ключ (TTLock)" button in BookingDetailPanel for confirmed/checked_in
- TTLock page added to sidebar under Настройки

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-31 15:46:17 +03:00
parent 7a3772d1cf
commit be92d026e8
11 changed files with 1095 additions and 4 deletions

View File

@@ -11,6 +11,8 @@ export type WsMessage =
| { type: 'housekeeping_updated'; task: Record<string, unknown> }
| { type: 'housekeeping_done'; taskId: string; roomId: string; roomStatus: string }
| { type: 'notification:new'; notification: Record<string, unknown> }
| { type: 'workstation:online'; workstationId: string }
| { type: 'workstation:offline'; workstationId: string }
interface Options {
slug: string