attik-frontend/src/app/tools/dispatch/dispatchContext.tsx → cleanSearchCoords → callDirectionsServer). Drive time is computed from coordinates, not from the address string.attik-backend/src/routes/calendar.ts):inspection.property.address (fallback inspection.address)inspection.lat / inspection.lngattik-backend/src/models/inspectionSchema.ts):lat / lng — used by dispatch, calendar, reschedule previewproperty.lat / property.lng — used by work order map, scheduler, pricingattik-backend/src/util/functions/inspection/createInspection.ts). On property edit from the work order, only property is PATCHed (attik-frontend/src/app/tools/inspections/[id]/components/PropertySectionWrapper.tsx sends { property: propertyData }). Backend updates property.lat / property.lng but does not mirror to top-level unless lat / lng are sent separately (attik-backend/src/routes/inspection.ts).property.lat) looks correct but the dispatch pin is wrong → likely stale top-level coordinates after a property/address correction. If both are wrong → bad geocoding at creation or bad coords from import (ISN/Spectora).Primary: duplicate coordinate fields drift after property/address updates.
property.lat / property.lng update with new geocode.inspection.lat / inspection.lng remain at original scheduling/import values.$inspection.lat / $inspection.lng into dispatch events while address text comes from property.address.cleanSearchCoords use the stale top-level coords → wrong pin + wrong drive time despite correct address tooltip.Secondary causes to rule out on example job:
latitude / longitude from source order (attik-backend/src/util/functions/isn/importIsnHistoricalOrder.ts sets both levels the same at import—less likely unless address edited post-import).lat/lng = 0) skipped in routing—usually omits pin rather than wrong location.Backend (attik-backend)
src/routes/calendar.ts — calendar event projection uses top-level lat/lng only; consider $ifNull fallback to property.lat / property.lng for legacy/drifted records.src/routes/inspection.ts — when property.lat / property.lng (or full property address) update, mirror coords (and optionally address) to top-level inspection.lat / inspection.lng / inspection.address.src/models/inspectionSchema.ts — document single source of truth or pre-save sync if appropriate.src/routes/schedule.ts — optimal-slots path also references $inspection.lat; verify parity after fix.property.lat/lng ≠ top-level lat/lng (or property has coords and top-level is 0).Frontend (attik-frontend)
src/app/tools/inspections/[id]/components/PropertySectionWrapper.tsx — property save sends only property; may also send top-level lat/lng as belt-and-suspenders until backend sync exists.src/app/tools/dispatch/dispatchContext.tsx and src/components/scheduling/dispatchScheduling/cleanSearchCoords.ts — verify routing uses corrected calendar payload (no client-side workaround needed if backend is fixed).src/components/scheduling/DispatchSection.tsx — scheduler dispatch section uses same calendar + directions pattern; confirm fix applies there too.src/app/tools/inspections/[id]/components/RescheduleJobModal.tsx — uses top-level inspection.lat/lng; should benefit from backend sync.Verification on example job
property lat/lng in DB/API before and after fix.Out of scope (v1)
property coords diverge.attik-backend/src/routes/calendar.tsattik-backend/src/routes/inspection.tsattik-frontend/src/app/tools/dispatch/dispatchContext.tsxattik-frontend/src/components/scheduling/dispatchScheduling/cleanSearchCoords.tsPlease authenticate to join the conversation.
Triage
Main App
About 1 hour ago
Linear
Get notified by email when there are changes.
Triage
Main App
About 1 hour ago
Linear
Get notified by email when there are changes.