Use Zillow parcel hints for CAD lookup

This commit is contained in:
2026-03-28 03:55:56 -05:00
parent ece8fc548f
commit b77134ced5
11 changed files with 438 additions and 18 deletions

View File

@@ -146,6 +146,47 @@ test("assessProperty auto-discovers listing sources, runs Zillow photos first, a
assert.deepEqual(result.reportPayload?.recipientEmails, []);
});
test("assessProperty uses parcel/APN hints extracted from Zillow before CAD lookup when parcel ID was not provided", async () => {
const seenPublicRecordOptions: Array<Record<string, unknown>> = [];
const result = await assessProperty(
{
address: "6702 Everhart Rd APT T106, Corpus Christi, TX 78413",
assessmentPurpose: "college housing for daughter attending TAMU-CC"
},
{
resolvePublicRecordsFn: async (_address, options) => {
seenPublicRecordOptions.push({ ...options });
return samplePublicRecords;
},
discoverListingSourcesFn: async () => ({
attempts: ["Zillow discovery located a property page from the address."],
zillowUrl:
"https://www.zillow.com/homedetails/6702-Everhart-Rd-APT-T106-Corpus-Christi-TX-78413/2067445642_zpid/",
harUrl: null
}),
extractZillowIdentifierHintsFn: async () => ({
parcelId: "1234567890",
notes: ["Zillow listing exposed parcel/APN number 1234567890."]
}),
extractPhotoDataFn: async (source, url) => ({
source,
requestedUrl: url,
finalUrl: url,
expectedPhotoCount: 29,
complete: true,
photoCount: 29,
imageUrls: ["https://photos.example/1.jpg"],
notes: [`${source} extractor succeeded.`]
})
}
);
assert.equal(result.ok, true);
assert.equal(seenPublicRecordOptions.length, 1);
assert.equal(seenPublicRecordOptions[0]?.parcelId, "1234567890");
});
test("assessProperty asks for recipient email only when PDF render is explicitly requested", async () => {
const result = await assessProperty(
{