Send RepairPricer when client phone matches agent phone

Objective

  • When the client and agent are effectively the same person (shared phone), still deliver the RepairPricer preview report the agent expects.
  • Stop blocking the entire HomeBinder send for these jobs — today they never reach HomeBinder, so RepairPricer (which is triggered from the HomeBinder payload) never runs.
  • Handle duplicate client/agent contact details safely without assuming misconfiguration cannot occur.

Background

  • Product feedback (Richard J. Ramirez, attik-talk): OHI work order 912 Lake Destiny Road #F was not sent to HomeBinder because "Client phone number matches agent phone" — same person in both roles. This is likely not a HomeBinder Automation (HBA) sales opportunity, but the agent still wants the RepairPricer (RP) preview.
  • Triage verdict: integration design gap. The phone_matches_agent filter is intentional in Attik validation, but it blocks RepairPricer along with HBA because Attik has no direct RepairPricer integration — RP is triggered only when HomeBinder receives a payload whose documents include main_type: "Report" and sub_type: "Residential Inspection" (see REPAIR_PRICER_REGEX in formatHomeBinderPayload.ts).
  • validateHomeBinderData in attik-backend/src/util/functions/homebinder/validateHomeBinderData.ts rejects sends when normalized client phone matches any buying/selling agent phone; sendToHomeBinder.ts persists status: 'filtered' with filterReason: 'phone_matches_agent' on the homebinderintegrations record.
  • Workorder UI (HomeBinder.tsx) shows Filtered with description "Did not meet HomeBinder requirements"; manual Resend (POST /inspection/:id/homebinder/resend) re-runs the same validation.
  • Stakeholder options raised: (1) still send to HomeBinder but have HomeBinder suppress HBA while RP runs; (2) exclude these sends from Attik Post-Inspection Revenue / Concierge dashboard metrics and accounting/invoicing; (3) integrate directly with RepairPricer if still available (legacy Spectora path — not present in Attik codebase today).
  • HomeBinder auto-send is triggered from change streams when inspection is paid and move-service reports complete (reportStream.ts, inspectionStream.ts). ATT-1610 (done) established the move-service report gate RepairPricer depends on.
  • Slack thread — Richard J. Ramirez request

Product Decisions

Locked

  1. Problem type — Integration design gap: the phone_matches_agent filter correctly blocks a full HBA-style send today, but it also prevents RepairPricer because RP only flows through the HomeBinder payload path in Attik.
  2. Primary outcome — Agents should still receive the RepairPricer preview report when client and agent share contact details (concrete repro: OHI / 912 Lake Destiny Road #F).
  3. HBA vs RP distinction — When client and agent are the same person, treat as not an HBA opportunity, but RepairPricer is still desired.
  4. Current technical path — RepairPricer is triggered from HomeBinder payload documents (formatHomeBinderPayload.ts / REPAIR_PRICER_REGEX); there is no separate RepairPricer API integration in Attik today.

Open

  1. Integration approach — Prefer send to HomeBinder with HBA suppressed (HomeBinder-side filter) vs Attik payload/flag variant vs direct RepairPricer integration? Direct RP requires confirming RepairPricer still offers a standalone API (legacy Spectora partnership path).
  2. HomeBinder partner requirements — Can HomeBinder accept the payload and trigger RP while suppressing HBA for same-person client/agent? What payload fields or template settings are required? Needs HomeBinder confirmation before build.
  3. Match criteria — Is normalized phone match sufficient (current rule), or should same email, same contact record on both roles, or other signals also qualify?
  4. Dashboard / Concierge metrics — Post-Inspection Revenue funnel (adminPostInspectionRevenue.ts / ConciergeAdoptionSection.tsx) counts sent vs filtered. Should RP-only or same-person sends be: excluded from Concierge Eligible → Sent rate, tracked under a new status/reason, or counted as sent with a flag?
  5. Accounting / invoicing — What specifically should be filtered: SE concierge billing to HomeBinder, admin CSV exports (exportHomeBinderSentSpreadsheet.ts), QuickBooks, or other revenue attribution? Define "done" for finance.
  6. Integration record semantics — Should these jobs show sent with a sub-reason (e.g. repair_pricer_only), remain filtered with a new reason, or use a new status? Affects workorder UI (HomeBinder.tsx) and resend behavior.
  7. Scope of brands / instances — All HomeBinder-connected Attik companies, or specific instances (OHI called out in feedback)?
  8. Backfill — Should previously filtered + phone_matches_agent jobs be eligible for automatic retry once behavior changes?

Scope

Backend (attik-backend)

  • validateHomeBinderData.ts — Today hard-stops on phone_matches_agent; behavior change depends on locked open decisions (allow send with flag, split validation paths, etc.).
  • sendToHomeBinder.ts — Orchestrates validation, payload build, API call, and homebinderintegrations status; may need new filter reason, send mode, or post-send metadata.
  • formatHomeBinderPayload.ts — Builds documents array that triggers RepairPricer via REPAIR_PRICER_REGEX / sub_type: "Residential Inspection"; may need payload adjustments per HomeBinder partner guidance.
  • homeBinderIntegrationSchema.ts — Status enum is not_sent | pending | sent | error | filtered; may need new reason codes or fields for RP-only sends.
  • routes/homebinder.ts — Status API and manual resend; filtered jobs surface filterDescription from getFilterReasonDescription.
  • Post-Inspection RevenueadminPostInspectionRevenue.ts aggregates concierge funnel and filter-reason breakdown; may need to exclude or reclassify same-person sends per product decision.
  • ExportsexportHomeBinderResults.ts, exportHomeBinderSentSpreadsheet.ts used for admin spreadsheet / invoicing workflows.

Frontend (attik-frontend)

  • HomeBinder.tsx (workorder integrations) — Displays filtered state and resend; may need copy/UX for RP-only or partial-send scenarios.
  • ConciergeAdoptionSection.tsx (admin post-inspection revenue) — KPIs and exports for HomeBinder send rate; may need metric treatment for same-person sends.

Mobile

  • Not in scope — HomeBinder send and RepairPricer trigger are backend/web integration flows.

References

  • Slack — Richard J. Ramirez request
  • Validation: attik-backend/src/util/functions/homebinder/validateHomeBinderData.ts
  • Send orchestration: attik-backend/src/util/functions/homebinder/sendToHomeBinder.ts
  • Payload / RepairPricer trigger: attik-backend/src/util/functions/homebinder/formatHomeBinderPayload.ts
  • Workorder UI: attik-frontend/src/app/tools/inspections/[id]/components/integrations/HomeBinder.tsx
  • Concierge dashboard: attik-frontend/src/app/admin/post-inspection-revenue/_components/ConciergeAdoptionSection.tsx
  • Related (done): ATT-1610 (HomeBinder send waits for move-service report completion)

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
🏠

Main App

Date

6 days ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.