Files
hotelsync/backend/migrations/002_netup.sql
HotelSync 61d25628ae Add NetUP IPTV integration module (TV Welcome settings page)
- DB: migrations/002_netup.sql — netup_settings + netup_room_mapping tables
- Backend: routes/netup.ts — GET/PATCH settings, POST test, GET/POST room
  mappings, POST send TV message; notifyNetupCheckin/Checkout helpers
- Backend: bookings PATCH — fire-and-forget NetUP check-in/out on status change
- Frontend: TvWelcomePage — connection settings tab + room mapping tab
- Frontend: sidebarItem added to tv-welcome module (shows in sidebar menu)
- Frontend: ModulesPage Settings button navigates to /tv-welcome
- Frontend: BookingModal — "Сообщение гостю на TV" panel for existing bookings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 18:18:41 +03:00

22 lines
1013 B
SQL

-- HotelSync Migration 002 — NetUP IPTV Integration
-- Отдельные таблицы под модуль "Приветствие на TV"
CREATE TABLE IF NOT EXISTS netup_settings (
hotel_id UUID PRIMARY KEY REFERENCES hotels(id) ON DELETE CASCADE,
server_url TEXT NOT NULL DEFAULT '',
username TEXT NOT NULL DEFAULT 'admin',
password TEXT NOT NULL DEFAULT '',
default_language TEXT NOT NULL DEFAULT 'ru_RU',
enabled BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Сопоставление: номер в PMS → номер в NetUP
CREATE TABLE IF NOT EXISTS netup_room_mapping (
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
pms_room_id UUID NOT NULL REFERENCES rooms(id) ON DELETE CASCADE,
netup_room_number TEXT NOT NULL,
PRIMARY KEY (hotel_id, pms_room_id)
);