CREATE TABLE IF NOT EXISTS rate_periods (
  id                UUID        PRIMARY KEY DEFAULT gen_random_uuid(),
  hotel_id          UUID        NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
  name              TEXT        NOT NULL,
  start_date        DATE        NOT NULL,
  end_date          DATE        NOT NULL,
  notes             TEXT,
  category_prices   JSONB       NOT NULL DEFAULT '{}',
  channel_markup    JSONB       NOT NULL DEFAULT '{}',
  extra_person_price INTEGER    NOT NULL DEFAULT 0,
  min_nights        INTEGER     NOT NULL DEFAULT 1,
  days_of_week      INTEGER[],
  created_at        TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  updated_at        TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
