feat(intake): structured per-service intake questions

Services declare up to 8 intake fields (text/yesno, required) stored
as JSONB; shared/intake.go is the single normalization point — slug
keys, label/dup/unknown-key rules, yes/no canonicalization. Booking
create validates answers against the service declaration (missing
required -> 400), unknown keys are dropped before persist.

Answers surface on UpcomingBooking and CustomerBookingView; the
services page gains a compact editor and the public form renders
declared questions under contact details. Verified live end-to-end.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-09-18 18:04:32 +02:00
1 parent ad60167a31
commit 33b6e2a2a6
20 files changed
+598 -41

No files matched your search

@@ -0,0 +1,13 @@
-- +goose Up
-- Schema-light structured intake: services declare a small list of intake
-- fields (key/label/type/required); bookings store the customer's answers as
-- a JSON object keyed by the declared field keys. Both default to empty so
-- existing services/bookings need no backfill.
ALTER TABLE services
ADD COLUMN intake_fields jsonb NOT NULL DEFAULT '[]'::jsonb;
ALTER TABLE bookings
ADD COLUMN intake jsonb NOT NULL DEFAULT '{}'::jsonb;
-- +goose Down
ALTER TABLE services DROP COLUMN IF EXISTS intake_fields;
ALTER TABLE bookings DROP COLUMN IF EXISTS intake;