test: fix current test suite

This commit is contained in:
2026-04-29 01:13:41 +00:00
parent db727e0a9d
commit fad8143ead
4 changed files with 9 additions and 12 deletions
+5 -9
View File
@@ -45,19 +45,15 @@ type CwOpportunityWithMembers = CwOpportunity & {
"memberRecId" | "primarySalesFlag" | "secondarySalesFlag"
>[];
soOppStatus?: Pick<CwSoOppStatus, "closedFlag"> | null;
soInterest?: { description: string | null } | null;
};
const toInterest = (
value: { description: string | null } | null
value: number | null
): OpportunityInterest | null => {
if (value == null) return null;
const desc = value.description?.toLowerCase() ?? "";
if (desc.includes("cold")) return OpportunityInterest.COLD;
if (desc.includes("warm") || desc.includes("medium"))
return OpportunityInterest.WARM;
if (desc.includes("hot")) return OpportunityInterest.HOT;
return null;
if (value <= 1) return OpportunityInterest.COLD;
if (value === 2) return OpportunityInterest.WARM;
return OpportunityInterest.HOT;
};
export const opportunityTranslation: Translation<
@@ -91,7 +87,7 @@ export const opportunityTranslation: Translation<
{ from: "soOppStatusRecId", to: "statusId" },
{ from: "taxCodeRecId", to: "taxCodeId" },
{
from: "soInterest",
from: "soInterestRecId",
to: "interest",
process: toInterest,
},