ARCH: выровнять ответ с текущим смыслом оборота контрагента
This commit is contained in:
@@ -79,6 +79,41 @@ describe("counterparty analytics reply builders", () => {
|
||||
expect(reply.text).not.toContain("max single");
|
||||
});
|
||||
|
||||
it("answers specific counterparty turnover directly instead of ranking", () => {
|
||||
const reply = composeFactualReply(
|
||||
"customer_revenue_and_payments",
|
||||
[
|
||||
{
|
||||
period: "2024-02-01T00:00:00Z",
|
||||
registrator: "Поступление 1",
|
||||
account_dt: "",
|
||||
account_kt: "",
|
||||
amount: 1000,
|
||||
analytics: ["СВК", "Договор СВК-1"]
|
||||
},
|
||||
{
|
||||
period: "2024-02-15T00:00:00Z",
|
||||
registrator: "Поступление 2",
|
||||
account_dt: "",
|
||||
account_kt: "",
|
||||
amount: 2500,
|
||||
analytics: ["СВК", "Договор СВК-1"]
|
||||
}
|
||||
],
|
||||
{
|
||||
userMessage: "какой оборот был свк",
|
||||
counterpartyHint: "свк"
|
||||
}
|
||||
);
|
||||
|
||||
expect(reply.responseType).toBe("FACTUAL_SUMMARY");
|
||||
expect(reply.text).toContain("Оборот по СВК за доступное время: 3.500,00");
|
||||
expect(reply.text).toContain("по 2 подтвержденным входящим операциям");
|
||||
expect(reply.text).toContain("Это денежный поток от клиента, а не чистая прибыль");
|
||||
expect(reply.text).not.toContain("Самый доходный клиент");
|
||||
expect(reply.text).not.toContain("Топ-");
|
||||
});
|
||||
|
||||
it("explains organization activity age as 1C activity rather than legal age", () => {
|
||||
const reply = composeFactualReply(
|
||||
"counterparty_activity_lifecycle",
|
||||
@@ -132,7 +167,8 @@ describe("counterparty analytics reply builders", () => {
|
||||
]);
|
||||
|
||||
expect(reply.responseType).toBe("FACTUAL_SUMMARY");
|
||||
expect(reply.text).toContain("Профиль договорной базы собран по справочнику и подтвержденным операциям.");
|
||||
expect(reply.text).toContain("Коротко: Использованных договоров: 148 из 520 (28.5%).");
|
||||
expect(reply.text).toContain("Что видно по договорной базе: 2 строк в подтвержденной выборке.");
|
||||
expect(reply.text).toContain("Использованных договоров с подтвержденной связью с операциями: 148.");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user