Objective
- Surface the Referral Source field on the Work Order so team members can see it while reviewing a job without leaving the page or exporting data.
- Eliminate the current friction of having to download a full inspections export and match by address or invoice number to find this value for a single job.
- Ensure parity between the booking form and the Work Order — Referral Source is the only booking-form field that disappears after a quote converts to an inspection.
Background
- Referral Source is collected during the quote and online scheduling flows and stored on both the Quote and Inspection records.
- The field is already available in Reports Hub under both the Inspections and Quotes collections, labeled "Referral Source," and is filterable.
- No Work Order UI component currently renders
referralSource— it was never added, not removed. TheBookingDetailsBoxcomponent is the natural home for this field as it already groups booking-origin context (Scheduled By, Confirmed By, Canceled By). - The
InspectionFullyPopulatedtype already passes the inspection object intoBookingDetailsBox, soreferralSourceis available in the component's props with no additional fetching required.
Product Decisions
Locked
- Display location — Show Referral Source in the existing
BookingDetailsBoxcomponent on the Work Order, alongside the other booking context fields. - Display behavior — Show the field only when a value is present; omit it entirely if
referralSourceis null or an empty string.
Open
- Editability — Should Referral Source be read-only on the Work Order, or should team members be able to update it after booking? If editable, a PATCH to the inspection endpoint is straightforward, but the UX pattern (inline edit vs. modal) needs a decision. Read-only is the safe default.
Scope
Frontend (attik-frontend)
src/app/tools/inspections/[id]/components/BookingDetailsBox.tsx— Primary change. Add a Referral Source row below the existing Scheduled/Confirmed/Canceled grid. Readsinspection.referralSource; renders conditionally when present.src/app/tools/inspections/[id]/components/WorkorderPage.tsx— No changes expected;inspectionis already passed toBookingDetailsBox.
References
referralSourcefield definition insrc/config/exportFieldDefinitions.ts(bothinspectionFieldsandquoteFields)src/models/inspectionSchema.ts— confirms field stored on inspectionsrc/util/functions/inspection/createInspection.ts— confirms field written at booking time