АРЧ АП11 - Архитектура: вынести inventory intent-family из resolveAddressIntent и зафиксировать pre-expansion cut
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { resolveInventoryAddressIntent } from "../src/services/addressInventoryIntentSignals";
|
||||
import { resolveAddressIntent } from "../src/services/addressIntentResolver";
|
||||
|
||||
describe("addressInventoryIntentSignals", () => {
|
||||
it("classifies warehouse snapshot wording through the extracted inventory owner", () => {
|
||||
const result = resolveInventoryAddressIntent("show inventory on hand as of 2020-03-15");
|
||||
|
||||
expect(result?.intent).toBe("inventory_on_hand_as_of_date");
|
||||
expect(result?.reasons).toContain("inventory_on_hand_signal_detected");
|
||||
});
|
||||
|
||||
it("classifies selected-object purchase provenance wording through the extracted inventory owner", () => {
|
||||
const result = resolveInventoryAddressIntent("selected object supplier provenance");
|
||||
|
||||
expect(result?.intent).toBe("inventory_purchase_provenance_for_item");
|
||||
expect(result?.reasons).toContain("inventory_selected_object_provenance_signal_detected");
|
||||
});
|
||||
|
||||
it("keeps the main resolver behavior stable through inventory-owner delegation", () => {
|
||||
const result = resolveAddressIntent("а по этой позиции когда была закупка?");
|
||||
|
||||
expect(result.intent).toBe("inventory_purchase_provenance_for_item");
|
||||
expect(result.reasons).toContain("inventory_purchase_date_signal_detected");
|
||||
});
|
||||
|
||||
it("does not steal non-inventory open-items wording into the inventory owner", () => {
|
||||
const result = resolveInventoryAddressIntent("хвосты покажи по счету 60 на август 2022");
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user