[object Object]

← back to NationalPaperHangers

Migration 022: room_captures JSONB on bookings

81398ebe24876076531c40bee7175c89baf28280 · 2026-05-18 16:32:06 -0700 · SteveStudio2

Stores camera-captured rooms for the quote brief — per-wall photo/video,
customer-confirmed dimensions, and optional customer-supplied wallpaper
(exact panel width + pattern repeat) for an on-wall scaled preview.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 81398ebe24876076531c40bee7175c89baf28280
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date:   Mon May 18 16:32:06 2026 -0700

    Migration 022: room_captures JSONB on bookings
    
    Stores camera-captured rooms for the quote brief — per-wall photo/video,
    customer-confirmed dimensions, and optional customer-supplied wallpaper
    (exact panel width + pattern repeat) for an on-wall scaled preview.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
 db/migrations/022_room_captures.sql | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/db/migrations/022_room_captures.sql b/db/migrations/022_room_captures.sql
new file mode 100644
index 0000000..8ff3e81
--- /dev/null
+++ b/db/migrations/022_room_captures.sql
@@ -0,0 +1,34 @@
+-- 022 · Room capture & measure — camera-driven booking brief
+--
+-- The customer photographs/videos each room, marks the wall, confirms its
+-- height & width, and optionally uploads the wallpaper they intend to use
+-- (with its exact panel width + pattern repeat) so it can be previewed on the
+-- measured wall. The whole package travels with the booking so the installer
+-- quotes from real footage + dimensions instead of a typed guess.
+--
+-- One JSONB array rather than a child table: captures are write-once with the
+-- booking, always read as a unit, and never queried field-wise.
+
+BEGIN;
+
+ALTER TABLE bookings
+  ADD COLUMN IF NOT EXISTS room_captures JSONB NOT NULL DEFAULT '[]'::jsonb;
+
+-- Shape of each element (all distances in feet unless noted):
+--   {
+--     "room":            "Dining room",
+--     "wall_width_ft":    12.5,
+--     "wall_height_ft":   9,
+--     "photo_url":        "/uploads/bookings/<batch>/<hash>.jpg",
+--     "video_url":        "/uploads/bookings/<batch>/<hash>.mp4" | null,
+--     "wallpaper": {                       -- null when the customer skips it
+--       "image_url":  "/uploads/bookings/<batch>/<hash>.jpg",
+--       "width_in":   27,                  -- exact panel/roll width, inches
+--       "repeat_in":  18,                  -- vertical pattern repeat, inches
+--       "match_type": "straight" | "half_drop"
+--     }
+--   }
+COMMENT ON COLUMN bookings.room_captures IS
+  'Camera-captured rooms: per-wall photo/video, confirmed dimensions, and optional customer-supplied wallpaper (width + repeat) for on-wall preview.';
+
+COMMIT;

← 841f9be Surface the structured booking brief in the installer notifi  ·  back to NationalPaperHangers  ·  Add POST /api/booking-media — public upload for the room-cap 9df4b87 →