-- Custom role permissions per hotel
CREATE TABLE IF NOT EXISTS role_permissions (
  id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  hotel_id    UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
  role_key    VARCHAR(50) NOT NULL,
  name        VARCHAR(100) NOT NULL,
  color       VARCHAR(20) NOT NULL DEFAULT '#6B7280',
  is_system   BOOLEAN NOT NULL DEFAULT false,
  permissions JSONB NOT NULL DEFAULT '{}',
  created_at  TIMESTAMPTZ NOT NULL DEFAULT now(),
  updated_at  TIMESTAMPTZ NOT NULL DEFAULT now(),
  UNIQUE(hotel_id, role_key)
);
