Слияние частей A и B этапа 2 (разрешены конфликты: задания, MCP-инструменты, формат ответа категоризации)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,10 +42,15 @@ d("категоризация (временная БД)", () => {
|
||||
run_id: "run-1",
|
||||
results: [
|
||||
{ feed_txn_id: "t1", suggestion: { account: "55", project_customer_id: "7", splits: [] }, confidence: 91, problem_highlight: null },
|
||||
{ feed_txn_id: "t2", suggestion: null, confidence: null, problem_highlight: "ждёт документ" },
|
||||
{ feed_txn_id: "t2", suggestion: null, confidence: null, problem_highlight: "ждёт документ", txn: { amount: -123.4, vendor: "Home Depot", date: "2026-11-10", card_or_account: "4242" } },
|
||||
{ feed_txn_id: "t3", suggestion: null },
|
||||
],
|
||||
})));
|
||||
// данные операции (для процесса «Поиск чека») сохраняются отдельно, сумма - положительным числом
|
||||
const feed = (await db.pool.query("select feed_txn_id, amount, vendor_name, card_or_account, to_char(txn_date, 'YYYY-MM-DD') d from acc_feed_txn")).rows;
|
||||
expect(feed).toHaveLength(1);
|
||||
expect(feed[0]).toMatchObject({ feed_txn_id: "t2", vendor_name: "Home Depot", card_or_account: "4242", d: "2026-11-10" });
|
||||
expect(Number(feed[0].amount)).toBe(123.4);
|
||||
expect(r).toMatchObject({ status: "ok", runId: "run-1", parsed: 3, inserted: 3, skipped: 0 });
|
||||
const rows = (await db.pool.query("select feed_txn_id, run_id, confidence, problem_highlight, suggestion from acc_categorization_review order by 1")).rows;
|
||||
expect(rows[0]).toMatchObject({ feed_txn_id: "t1", run_id: "run-1", confidence: 91, problem_highlight: null });
|
||||
|
||||
Reference in New Issue
Block a user