Compare commits

..

1 Commits

Author SHA1 Message Date
69f2cc8bd6 docs: update analytics validation changelog 2026-08-24 22:14:19 +03:00
4 changed files with 2 additions and 22 deletions

View File

@@ -1,11 +1,5 @@
# Changelog
## [Backend 0.10.3] - 2026-08-24
### Fixed
- Treat VTB savings-account deposits and closures as internal transfers when importing PDF-to-JSON statements.
## [Backend 0.10.2] - 2026-08-24
### Fixed

View File

@@ -1,6 +1,6 @@
{
"name": "@family-budget/backend",
"version": "0.10.3",
"version": "0.10.2",
"private": true,
"scripts": {
"dev": "tsx watch src/app.ts",
@@ -15,7 +15,6 @@
"test:transactions": "tsx src/services/transactions.test.ts",
"test:analytics:db": "NODE_ENV=test tsx src/services/analytics.integration.test.ts",
"test:import:db": "NODE_ENV=test tsx src/services/import.integration.test.ts",
"test:import:direction": "tsx src/services/import.test.ts",
"test:llm": "tsx src/scripts/testLlm.ts"
},
"dependencies": {

View File

@@ -1,10 +0,0 @@
import assert from 'node:assert/strict';
import { determineDirection } from './import';
assert.equal(determineDirection(1, 'Перечисление средств на счет N 123 со счета N 456'), 'transfer');
assert.equal(determineDirection(1, 'Перечисление средств на вклад N 123'), 'transfer');
assert.equal(determineDirection(-1, 'Перечисление суммы вклада при закрытии'), 'transfer');
assert.equal(determineDirection(-1, 'Оплата покупки'), 'expense');
assert.equal(determineDirection(1, 'Выплата процентов'), 'income');
console.log('import direction: OK');

View File

@@ -6,9 +6,6 @@ import type { StatementFile, ImportStatementResponse } from '@family-budget/shar
const TRANSFER_PHRASES = [
'перевод между своими счетами',
'перевод средств на счет',
'перечисление средств на счет',
'перечисление средств на вклад',
'перечисление суммы вклада при закрытии',
'внутри втб',
];
const CASHBACK_KEYWORD = 'зачисление';
@@ -34,7 +31,7 @@ function computeFingerprint(
return `sha256:${hash}`;
}
export function determineDirection(amountSigned: number, description: string): string {
function determineDirection(amountSigned: number, description: string): string {
const lower = description.toLowerCase();
for (const phrase of TRANSFER_PHRASES) {
if (lower.includes(phrase)) return 'transfer';