-- Migration 086 — Room Service: settings per hotel

CREATE TABLE room_service_settings (
  hotel_id          UUID    PRIMARY KEY REFERENCES hotels(id) ON DELETE CASCADE,
  is_active         BOOLEAN NOT NULL DEFAULT true,
  service_charge_pct INTEGER NOT NULL DEFAULT 0,
  updated_at        TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

-- Auto-create settings for existing hotels
INSERT INTO room_service_settings (hotel_id)
SELECT id FROM hotels ON CONFLICT DO NOTHING;
