Compare commits
1 Commits
fix/vtb-sa
...
fix/analyt
| Author | SHA1 | Date | |
|---|---|---|---|
| 69f2cc8bd6 |
@@ -1,11 +1,5 @@
|
|||||||
# Changelog
|
# 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
|
## [Backend 0.10.2] - 2026-08-24
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@family-budget/backend",
|
"name": "@family-budget/backend",
|
||||||
"version": "0.10.3",
|
"version": "0.10.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsx watch src/app.ts",
|
"dev": "tsx watch src/app.ts",
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
"test:transactions": "tsx src/services/transactions.test.ts",
|
"test:transactions": "tsx src/services/transactions.test.ts",
|
||||||
"test:analytics:db": "NODE_ENV=test tsx src/services/analytics.integration.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: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"
|
"test:llm": "tsx src/scripts/testLlm.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -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');
|
|
||||||
@@ -6,9 +6,6 @@ import type { StatementFile, ImportStatementResponse } from '@family-budget/shar
|
|||||||
const TRANSFER_PHRASES = [
|
const TRANSFER_PHRASES = [
|
||||||
'перевод между своими счетами',
|
'перевод между своими счетами',
|
||||||
'перевод средств на счет',
|
'перевод средств на счет',
|
||||||
'перечисление средств на счет',
|
|
||||||
'перечисление средств на вклад',
|
|
||||||
'перечисление суммы вклада при закрытии',
|
|
||||||
'внутри втб',
|
'внутри втб',
|
||||||
];
|
];
|
||||||
const CASHBACK_KEYWORD = 'зачисление';
|
const CASHBACK_KEYWORD = 'зачисление';
|
||||||
@@ -34,7 +31,7 @@ function computeFingerprint(
|
|||||||
return `sha256:${hash}`;
|
return `sha256:${hash}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function determineDirection(amountSigned: number, description: string): string {
|
function determineDirection(amountSigned: number, description: string): string {
|
||||||
const lower = description.toLowerCase();
|
const lower = description.toLowerCase();
|
||||||
for (const phrase of TRANSFER_PHRASES) {
|
for (const phrase of TRANSFER_PHRASES) {
|
||||||
if (lower.includes(phrase)) return 'transfer';
|
if (lower.includes(phrase)) return 'transfer';
|
||||||
|
|||||||
Reference in New Issue
Block a user