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_agentfilter 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 includemain_type: "Report"andsub_type: "Residential Inspection"(seeREPAIR_PRICER_REGEXinformatHomeBinderPayload.ts). validateHomeBinderDatainattik-backend/src/util/functions/homebinder/validateHomeBinderData.tsrejects sends when normalized client phone matches any buying/selling agent phone;sendToHomeBinder.tspersistsstatus: 'filtered'withfilterReason: 'phone_matches_agent'on thehomebinderintegrationsrecord.- 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
- Problem type — Integration design gap: the
phone_matches_agentfilter correctly blocks a full HBA-style send today, but it also prevents RepairPricer because RP only flows through the HomeBinder payload path in Attik. - 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).
- HBA vs RP distinction — When client and agent are the same person, treat as not an HBA opportunity, but RepairPricer is still desired.
- 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
- 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).
- 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.
- Match criteria — Is normalized phone match sufficient (current rule), or should same email, same contact record on both roles, or other signals also qualify?
- Dashboard / Concierge metrics — Post-Inspection Revenue funnel (
adminPostInspectionRevenue.ts/ConciergeAdoptionSection.tsx) countssentvsfiltered. 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? - 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. - Integration record semantics — Should these jobs show
sentwith a sub-reason (e.g.repair_pricer_only), remainfilteredwith a new reason, or use a new status? Affects workorder UI (HomeBinder.tsx) and resend behavior. - Scope of brands / instances — All HomeBinder-connected Attik companies, or specific instances (OHI called out in feedback)?
- Backfill — Should previously
filtered+phone_matches_agentjobs be eligible for automatic retry once behavior changes?
Scope
Backend (attik-backend)
validateHomeBinderData.ts— Today hard-stops onphone_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, andhomebinderintegrationsstatus; may need new filter reason, send mode, or post-send metadata.formatHomeBinderPayload.ts— Builds documents array that triggers RepairPricer viaREPAIR_PRICER_REGEX/sub_type: "Residential Inspection"; may need payload adjustments per HomeBinder partner guidance.homeBinderIntegrationSchema.ts— Status enum isnot_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 surfacefilterDescriptionfromgetFilterReasonDescription.- Post-Inspection Revenue —
adminPostInspectionRevenue.tsaggregates concierge funnel and filter-reason breakdown; may need to exclude or reclassify same-person sends per product decision. - Exports —
exportHomeBinderResults.ts,exportHomeBinderSentSpreadsheet.tsused 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)