CREATE TABLE minibar_items (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
  name TEXT NOT NULL,
  price NUMERIC(10,2) NOT NULL DEFAULT 0,
  category TEXT,
  is_active BOOLEAN NOT NULL DEFAULT true,
  sort_order INTEGER NOT NULL DEFAULT 0
);

CREATE TABLE minibar_consumptions (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  hotel_id UUID NOT NULL REFERENCES hotels(id),
  room_id UUID NOT NULL REFERENCES rooms(id),
  booking_id UUID REFERENCES bookings(id),
  task_id UUID REFERENCES housekeeping_tasks(id),
  item_id UUID NOT NULL REFERENCES minibar_items(id),
  quantity INTEGER NOT NULL DEFAULT 1,
  price_per_unit NUMERIC(10,2) NOT NULL,
  recorded_by UUID REFERENCES users(id),
  recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
