- Migration 084: add review_token, review_email_sent_at, review_retry_sent_at to bookings - Backend route /api/hotels/:slug/reviews (GET list, PATCH reply/status) - Backend public routes /api/public/review/:token (GET config, POST submit) - email.ts: sendReviewRequestEmail template - jobs.ts: runReviewRequestJob — sends email N hours after checkout, retry after 24h - app.ts: register reviewsRoutes - api.ts: add ReviewApi, PublicReviewConfig types + reviews/publicReview methods - ReviewsPage: connect to real API, load/save settings, remove SMS option - GuestReviewPage: use :token param, fetch config from API, submit to API - App.tsx: route /review/:slug → /review/:token Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 lines
336 B
SQL
9 lines
336 B
SQL
-- Migration 084 — review tokens on bookings
|
|
|
|
ALTER TABLE bookings
|
|
ADD COLUMN IF NOT EXISTS review_token TEXT UNIQUE,
|
|
ADD COLUMN IF NOT EXISTS review_email_sent_at TIMESTAMPTZ,
|
|
ADD COLUMN IF NOT EXISTS review_retry_sent_at TIMESTAMPTZ;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_bookings_review_token ON bookings(review_token);
|