Files
hotelsync/backend/migrations/046_wifi_settings.sql
HotelSync 0088457f51 feat: add WiFi authorization module
- Backend: hotel_wifi_settings table (migration 046), CRUD routes
- Public API endpoint /api/wifi-auth/verify for captive portal
- Auth methods: room+lastname, room+birthdate, room+any, room_only
- Frontend: WiFiPage with settings, token management, setup guide
- Guide tabs: MikroTik, UniFi, Universal with copy-paste instructions
- Sidebar: WiFi item in Settings group

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 12:08:51 +03:00

16 lines
821 B
SQL

-- WiFi Auth module settings per hotel
CREATE TABLE IF NOT EXISTS hotel_wifi_settings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
enabled BOOLEAN NOT NULL DEFAULT false,
api_token TEXT NOT NULL DEFAULT encode(gen_random_bytes(32), 'hex'),
auth_method TEXT NOT NULL DEFAULT 'room_any',
-- room_lastname | room_birthdate | room_any | room_only
ssid_name TEXT,
welcome_text TEXT DEFAULT 'Добро пожаловать! Введите данные для подключения к Wi-Fi.',
session_hours INT NOT NULL DEFAULT 24,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (hotel_id)
);