- Calendar cells: hold mouse 600ms to show price tooltip for that date/room (baseRate + hourly rate if enabled)
- AvailabilityPage: load real categories from API, derive basePrice from room baseRates, fall back to room types if no categories
- Rate periods: persisted to DB via new /api/hotels/:slug/rate-periods endpoint
- New backend migration 021_rate_periods.sql + rate-periods route
- Added api.ratePeriods.{list,create,update,delete} to frontend API client
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
706 B
SQL
16 lines
706 B
SQL
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()
|
|
);
|