Objective
- Add property county as persisted data on inspections (
inspection.property.county) so it is available for Reports Hub exports, report conditions/filters, and other product surfaces that use property fields. - Enable users to include County in custom inspection reports (column picker, preview, and CSV/XLSX export) alongside existing address fields.
Background
- Finance and ops need inspection rows identifiable by county alongside address and client context in flat exports.
- County is the net-new gap. Inspection
propertyinattik-backend/src/models/propertySchema.tsstores street, unit, city, state, zip, and related fields but does not persistcounty.exportFieldDefinitions.tshas no county column on inspections. - County already appears in transient sources but is not saved today:
- Scheduling: Zillow/Bridge parcel lookup returns
countyand displays it inZillowPropertyDetails.tsx, but create payloads inNewSchedulingForm.tsx/createInspection.tsdo not pass it through. - Spectora: Webhook property types include
county, butspectoraPropertyToServerProperty.tsdoes not map it — Spectora sync is out of scope for v1 write paths (see locked decisions). - Already available today (not in scope unless product reopens):
- Full address:
addresson inspections (legacy field synced frompropertyviagenerateAddress()inpropertySchema.ts/inspectionSchema.tspre-save). - Address components:
property.street,property.city,property.state,property.zipin the Reports Hub column picker. - Client name: via linked People on an inspections report (
firstName,lastName,roleName, filterpeople:roleName). No dedicated job-level Client Name column without linking People. - Feature request: Featurebase — County
- Child of Reports Hub update for Finance (ATT-1862).
Locked product decisions (v1)
- Persist county on
inspection.property.county— not export-time-only resolution. - Write paths in v1: persist county when available on:
- Scheduling (new jobs and scheduler-driven address updates)
- Manual property edits on the job
- Backfill for existing inspections missing county (see below)
- Not in v1 write paths: Spectora sync — do not map or persist county from Spectora webhooks/sync in this issue.
- Backfill: populate county on existing inspections where possible (e.g. Bridge/Zillow lookup via
fetchBridgeParcel.tsusing lat/lng or address). If the effort is large, assignee discusses scope with Ryan/Chris before expanding. - Reports Hub: exportable County column on Inspections (picker, preview, CSV/XLSX).
- Out of scope for v1: job-level
clientNamecomputed column; changes to existing full-address / street–zip fields; Spectora county sync.
Done when
property.countyexists on the schema and is saved on new/updated jobs via scheduling and manual edit paths when county data is present.- Backfill executed or explicitly deferred with Ryan/Chris if not feasible in v1.
- County appears in the Reports Hub column picker for Inspections, works in preview and export, and persists on saved reports.
- County is available as persisted property data for conditions/filters following the same patterns as other
property.*fields.
Scope
Backend
attik-backend/src/models/propertySchema.ts— addcountytoPropertyType/ schema.- Scheduling create/update:
attik-backend/src/util/functions/inspection/createInspection.ts— accept and persist county from address payload. - Manual property edit:
attik-backend/src/routes/inspection.ts— includeproperty.countyin PATCH handling alongside existing property fields. - Backfill: batch or script approach using existing Bridge/Zillow utilities (
fetchBridgeParcel.ts, frontendcallZillowAndMatch.tspatterns) — scope TBD with Ryan/Chris if heavy. - Explicitly out of scope:
spectoraPropertyToServerProperty.tsand Spectora sync paths — no county mapping in v1. attik-backend/src/config/exportFieldDefinitions.ts— registerproperty.countyoninspectionFieldswith label County.attik-backend/src/util/functions/dataExports/documentResolution.ts— resolve county like otherproperty.*fields.
Frontend
- Scheduling: pass county from Zillow/Bridge into create/update payloads when present (
PropertySection.tsx,NewSchedulingForm.tsx). - Manual job edit: surface county on property save if in scope for edit UI (
PropertySectionWrapper.tsx). - Reports Hub: column picker and preview (
CreateReportForm.tsx,ReportPreviewSection.tsx) — surface County when backend field defs expose it.
Out of scope
- Spectora sync county persistence.
- Job-level client name computed field (People link covers today).
- Changes to Full Address / existing
property.street–zipfields. - Wide service columns (ATT-1856), split date/time (ATT-1863).
References
- Featurebase — County
- Reports Hub update for Finance (ATT-1862)
- Property schema:
attik-backend/src/models/propertySchema.ts - Export field defs:
attik-backend/src/config/exportFieldDefinitions.ts - Scheduling create:
attik-backend/src/util/functions/inspection/createInspection.ts - Manual property PATCH:
attik-backend/src/routes/inspection.ts - Zillow/Bridge county source:
attik-frontend/src/util/functions/fetching/callZillowAndMatch.ts,attik-backend/src/util/functions/zillow/fetchBridgeParcel.ts - Spectora (out of scope v1):
attik-backend/src/util/functions/spectora/spectoraPropertyToServerProperty.ts