Remove pull integration; persist push log to DB (last 50 per hotel)
- Remove TravelLine/netup-pms pull route (travelline.ts unused) - Remove pull integration section from TvWelcomePage (token field, API URL, etc.) - Migration 008: netup_push_log table (hotel_id, action, status, request/response body) - recordPush() now writes to DB in addition to in-memory buffer - getLog reads from DB so logs survive server restarts - clearLog deletes from DB - Limit enforced: 50 rows per hotel (oldest auto-deleted) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
16
backend/migrations/008_netup_push_log.sql
Normal file
16
backend/migrations/008_netup_push_log.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE TABLE IF NOT EXISTS netup_push_log (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
|
||||
ts TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
action TEXT NOT NULL, -- 'check-in' | 'check-out' | 'message'
|
||||
room_number TEXT NOT NULL DEFAULT '',
|
||||
netup_room TEXT NOT NULL DEFAULT '',
|
||||
url TEXT NOT NULL DEFAULT '',
|
||||
request_body JSONB,
|
||||
status TEXT NOT NULL, -- 'ok' | 'error' | 'skipped'
|
||||
http_status INT,
|
||||
response_body TEXT,
|
||||
error TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_netup_push_log_hotel_ts ON netup_push_log(hotel_id, ts DESC);
|
||||
Reference in New Issue
Block a user