@actual-app/sync-server 25.7.0-nightly.20250628 → 25.7.0-nightly.20250629
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { formatPayeeName } from '../../util/payee-name.js';
|
|
2
|
+
import { title } from '../../util/title/index.js';
|
|
3
|
+
import Fallback from './integration-bank.js';
|
|
4
|
+
/** @type {import('./bank.interface.js').IBank} */
|
|
5
|
+
export default {
|
|
6
|
+
...Fallback,
|
|
7
|
+
institutionIds: ['RAIFFEISEN_AT_RZBAATWW'],
|
|
8
|
+
normalizeTransaction(transaction, booked) {
|
|
9
|
+
const editedTrans = { ...transaction };
|
|
10
|
+
let payeeName = formatPayeeName(transaction);
|
|
11
|
+
if (!payeeName) {
|
|
12
|
+
payeeName = extractPayeeName(transaction);
|
|
13
|
+
}
|
|
14
|
+
editedTrans.payeeName = payeeName;
|
|
15
|
+
// avoid empty notes if payee is set but no information in unstructured information
|
|
16
|
+
// if no structured or unstructured information is provided, return the endToEndId instead
|
|
17
|
+
editedTrans.remittanceInformationUnstructured =
|
|
18
|
+
transaction.remittanceInformationUnstructured ??
|
|
19
|
+
transaction.remittanceInformationStructured ??
|
|
20
|
+
transaction.endToEndId;
|
|
21
|
+
return Fallback.normalizeTransaction(transaction, booked, editedTrans);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Extracts the payee name from the remittanceInformationStructured
|
|
26
|
+
* @param {import('../gocardless-node.types.js').Transaction} transaction
|
|
27
|
+
*/
|
|
28
|
+
function extractPayeeName(transaction) {
|
|
29
|
+
const structured = transaction.remittanceInformationStructured;
|
|
30
|
+
// The payee name is at the beginning and has a max length of 12 characters
|
|
31
|
+
// (if structured information is actually structured ...).
|
|
32
|
+
const regex = /(.{12}) \d{4} .* \d{2}\.\d{2}\. \d{2}:\d{2}/;
|
|
33
|
+
const matches = structured.match(regex);
|
|
34
|
+
if (matches && matches.length > 1 && matches[1]) {
|
|
35
|
+
const name = title(matches[1]);
|
|
36
|
+
// These transactions never contained creditor information in my tests, thus no
|
|
37
|
+
// attempt to add the IBAN to the name...
|
|
38
|
+
return name;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
// As a fallback if still no payee is found, the whole information is used
|
|
42
|
+
return structured;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { mockTransactionAmount } from '../../services/tests/fixtures.js';
|
|
2
|
+
import RaiffeisenAtRzbaatww from '../raiffeisen_at_rzbaatww.js';
|
|
3
|
+
describe('raiffeisen_at', () => {
|
|
4
|
+
describe('#normalizeTransaction', () => {
|
|
5
|
+
it('returns the full structured information as payeeName from a transaction with no payee name', () => {
|
|
6
|
+
const transaction = {
|
|
7
|
+
transactionId: '10_2025-01-01_0123456789',
|
|
8
|
+
bookingDate: '2025-01-01',
|
|
9
|
+
valueDate: '2025-01-01',
|
|
10
|
+
transactionAmount: mockTransactionAmount,
|
|
11
|
+
remittanceInformationStructured: 'NOTHING STRUCTURED',
|
|
12
|
+
internalTransactionId: '01234567890123456789',
|
|
13
|
+
};
|
|
14
|
+
const normalizedTransaction = RaiffeisenAtRzbaatww.normalizeTransaction(transaction, true);
|
|
15
|
+
expect(normalizedTransaction.payeeName).toEqual('NOTHING STRUCTURED');
|
|
16
|
+
});
|
|
17
|
+
it('returns the expected payeeName from a transaction with payee name inside structuredInformation', () => {
|
|
18
|
+
const transaction = {
|
|
19
|
+
transactionId: '10_2025-01-01_0123456789',
|
|
20
|
+
bookingDate: '2025-01-01',
|
|
21
|
+
valueDate: '2025-01-01',
|
|
22
|
+
transactionAmount: mockTransactionAmount,
|
|
23
|
+
remittanceInformationStructured: 'COMPANY ABCD 2610 D5 01.01. 13:37',
|
|
24
|
+
internalTransactionId: '01234567890123456789',
|
|
25
|
+
};
|
|
26
|
+
const normalizedTransaction = RaiffeisenAtRzbaatww.normalizeTransaction(transaction, true);
|
|
27
|
+
expect(normalizedTransaction.payeeName).toEqual('Company Abcd');
|
|
28
|
+
});
|
|
29
|
+
it('returns the creditorName for transactions containing one', () => {
|
|
30
|
+
const transaction = {
|
|
31
|
+
transactionId: '18_2025-01-01_0123456789',
|
|
32
|
+
bookingDate: '2025-01-01',
|
|
33
|
+
valueDate: '2025-01-01',
|
|
34
|
+
transactionAmount: mockTransactionAmount,
|
|
35
|
+
creditorName: 'Reci Pient',
|
|
36
|
+
creditorAccount: {
|
|
37
|
+
iban: 'AT201100021493538935',
|
|
38
|
+
},
|
|
39
|
+
remittanceInformationStructured: 'just some text here',
|
|
40
|
+
additionalInformation: 'more info',
|
|
41
|
+
internalTransactionId: '01234567890123456789',
|
|
42
|
+
};
|
|
43
|
+
const normalizedTransaction = RaiffeisenAtRzbaatww.normalizeTransaction(transaction, true);
|
|
44
|
+
expect(normalizedTransaction.payeeName).toEqual('Reci Pient (AT20 XXX 8935)');
|
|
45
|
+
});
|
|
46
|
+
it('returns the unstructured information for POS transactions without payee name or useful structured information', () => {
|
|
47
|
+
const transaction = {
|
|
48
|
+
transactionId: '18_2025-01-01_0123456789',
|
|
49
|
+
bookingDate: '2025-01-01',
|
|
50
|
+
valueDate: '2025-01-01',
|
|
51
|
+
transactionAmount: mockTransactionAmount,
|
|
52
|
+
remittanceInformationUnstructured: 'COMPANY NAME CITY 1010',
|
|
53
|
+
remittanceInformationStructured: 'POS 1,11 AT D4 01.01. 13:37',
|
|
54
|
+
internalTransactionId: '01234567890123456789',
|
|
55
|
+
};
|
|
56
|
+
const normalizedTransaction = RaiffeisenAtRzbaatww.normalizeTransaction(transaction, true);
|
|
57
|
+
expect(normalizedTransaction.payeeName).toEqual('Company Name City 1010');
|
|
58
|
+
});
|
|
59
|
+
it('returns the endToEndId in notes if no structured or unstructured remittance information is present', () => {
|
|
60
|
+
const transaction = {
|
|
61
|
+
transactionId: '18_2025-01-01_0123456789',
|
|
62
|
+
bookingDate: '2025-01-01',
|
|
63
|
+
valueDate: '2025-01-01',
|
|
64
|
+
transactionAmount: mockTransactionAmount,
|
|
65
|
+
creditorName: 'Creditor',
|
|
66
|
+
endToEndId: 'Transaction 1234',
|
|
67
|
+
internalTransactionId: '01234567890123456789',
|
|
68
|
+
};
|
|
69
|
+
const normalizedTransaction = RaiffeisenAtRzbaatww.normalizeTransaction(transaction, true);
|
|
70
|
+
expect(normalizedTransaction.notes).toEqual('Transaction 1234');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actual-app/sync-server",
|
|
3
|
-
"version": "25.7.0-nightly.
|
|
3
|
+
"version": "25.7.0-nightly.20250629",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "actual syncing server",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@actual-app/crdt": "2.1.0",
|
|
31
|
-
"@actual-app/web": "25.7.0-nightly.
|
|
31
|
+
"@actual-app/web": "25.7.0-nightly.20250629",
|
|
32
32
|
"bcrypt": "^5.1.1",
|
|
33
33
|
"better-sqlite3": "^11.10.0",
|
|
34
34
|
"convict": "^6.2.4",
|