feat: persist rate overrides to DB when applying prices in AvailabilityPage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 16:14:45 +03:00
parent 8312d2372e
commit e5daf91ed4
5 changed files with 194 additions and 34 deletions

View File

@@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS rate_overrides (
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
category_id TEXT NOT NULL,
date DATE NOT NULL,
price INTEGER NOT NULL,
extra_person INTEGER NOT NULL DEFAULT 0,
min_nights INTEGER NOT NULL DEFAULT 1,
channel_prices JSONB NOT NULL DEFAULT '{}',
closed BOOLEAN NOT NULL DEFAULT false,
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY (hotel_id, category_id, date)
);