Include unit number in Past Jobs & Quotes address matching

Problem

Past Jobs & Quotes on the work order calls GET /past-jobs with zip, city, and street from the current inspection’s property. The backend matches other inspections and quotes by:

  • property.zip
  • normalized property.city
  • leading street number extracted from property.street only
  • optional regex on property.street for street name words

It does not use property.unit. For condos and multi-unit buildings where many units share the same street line and unit is stored in property.unit, the list effectively shows all jobs/quotes at that building address, not only the current unit.

Ask

Include unit (apartment/suite/condo unit) in the match logic so Past Jobs & Quotes reflects the same unit when property.unit is present, with sensible behavior when unit is blank or inconsistent (e.g. match building-level history only when unit is empty on both sides, or document the rule).

References

  • Frontend: PastJobsQuotes.tsx — passes zip, city, street only today; may need to pass unit when present.
  • Backend: attik-backend/src/routes/pastJobs.ts — aggregation $match stages; propertySchema already has optional property.unit.

Acceptance (draft)

  • When both the current job and a candidate job/quote have a non-empty property.unit, they match only if units align (normalization rules TBD: trim, case, # vs Unit prefix, etc.).
  • When the current job has no unit, behavior is defined (e.g. keep today’s building-level match, or exclude unit-specific rows — product call).
  • Quotes use the same rules as inspections for property.

Please authenticate to join the conversation.

Upvoters
Status

Planned

Board
💡

New Features

Date

About 21 hours ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.