Block preliminary property assessor PDFs
This commit is contained in:
@@ -4,7 +4,11 @@ import path from "node:path";
|
||||
import { discoverListingSources, type ListingDiscoveryResult } from "./listing-discovery.js";
|
||||
import { extractPhotoData, type PhotoExtractionResult, type PhotoSource } from "./photo-review.js";
|
||||
import { resolvePublicRecords, type PublicRecordsResolution } from "./public-records.js";
|
||||
import { renderReportPdf, type ReportPayload } from "./report-pdf.js";
|
||||
import {
|
||||
isDecisionGradeReportPayload,
|
||||
renderReportPdf,
|
||||
type ReportPayload
|
||||
} from "./report-pdf.js";
|
||||
|
||||
export interface AssessPropertyOptions {
|
||||
address: string;
|
||||
@@ -442,6 +446,20 @@ export async function assessProperty(
|
||||
};
|
||||
}
|
||||
|
||||
if (!isDecisionGradeReportPayload(reportPayload)) {
|
||||
return {
|
||||
ok: true,
|
||||
needsAssessmentPurpose: false,
|
||||
needsRecipientEmails: false,
|
||||
pdfReady: false,
|
||||
message:
|
||||
"The report payload is still preliminary. Do not render or send the PDF until comps, valuation, and a decision-grade verdict are completed.",
|
||||
outputPath: null,
|
||||
reportPayload,
|
||||
publicRecords
|
||||
};
|
||||
}
|
||||
|
||||
const outputPath =
|
||||
options.output ||
|
||||
path.join(
|
||||
|
||||
Reference in New Issue
Block a user