Finalize metrics verification and backlog updates

This commit is contained in:
2026-06-05 21:49:57 +02:00
parent d3928d61c4
commit f069b74b08
15 changed files with 240 additions and 36 deletions

View File

@@ -86,6 +86,7 @@ export type LeadFunnelOutreach = {
sendStatus?: OutreachSendStatus | null;
responseStatus?: OutreachResponseStatus | null;
salesStatus?: OutreachSalesStatus | null;
doNotContactUntil?: number | null;
};
export type LeadFunnelInput = {
@@ -103,6 +104,7 @@ export type LeadFunnelInput = {
contactPerson?: string | null;
websiteDomain?: string | null;
outreach?: LeadFunnelOutreach | null;
now?: number;
};
export type LeadFunnelCard = {
@@ -303,6 +305,14 @@ function getLeadNextAction(lead: LeadFunnelInput): string {
const stageId = getLeadFunnelStageId(lead);
if (stageId === "deferred") {
if (
lead.outreach?.salesStatus === "do_not_pursue" &&
typeof lead.outreach.doNotContactUntil === "number" &&
(lead.now ?? Date.now()) >= lead.outreach.doNotContactUntil
) {
return "Erneut prüfen";
}
return "Zurückstellung prüfen";
}