Архитектура: централизовать displayed-entity retarget в continuity policy и убрать dead owner из transition
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
resolveAddressDebugCarryoverFilters,
|
||||
resolveAddressDebugContextFacts,
|
||||
resolveAddressDebugAnchorContext,
|
||||
resolveDisplayedEntityFollowupRetarget,
|
||||
resolveAssistantOrganizationAuthority
|
||||
} from "../src/services/assistantContinuityPolicy";
|
||||
|
||||
@@ -350,4 +351,35 @@ describe("assistantContinuityPolicy organization authority", () => {
|
||||
previousAnchorValue: "Workstation Navigation"
|
||||
});
|
||||
});
|
||||
|
||||
it("resolves displayed-entity follow-up retarget and carryover through one shared helper", () => {
|
||||
const carryover = resolveDisplayedEntityFollowupRetarget(
|
||||
"покажи договоры по СВК",
|
||||
{
|
||||
entityType: "counterparty",
|
||||
value: "SVK Group"
|
||||
},
|
||||
{
|
||||
organization: "Org Alt"
|
||||
},
|
||||
null,
|
||||
null,
|
||||
"carry_previous_intent",
|
||||
false,
|
||||
(value) => String(value ?? "").replace(/\s+/g, " ").trim(),
|
||||
(value) => value
|
||||
);
|
||||
|
||||
expect(carryover).toEqual({
|
||||
displayedEntityTargetIntent: "list_contracts_by_counterparty",
|
||||
previousFilters: {
|
||||
organization: "Org Alt",
|
||||
counterparty: "SVK Group"
|
||||
},
|
||||
previousAnchorType: "counterparty",
|
||||
previousAnchorValue: "SVK Group",
|
||||
followupSelectionMode: "carry_referenced_entity",
|
||||
resolvedCounterpartyFromDisplay: true
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user