Finanzen: Index auf bankTransactions.status, Vormerkungssuche mit Rueckfall
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
588cc95f5d
commit
75ca8b78c0
4 files changed
+41
-3
No files matched your search
@@ -385,6 +385,23 @@ test('syncBank: gleiche entry_reference bei Vormerkung und Buchung -> ein Dokume
|
||||
assert.equal(txDocs().get(docId('same')).status, 'BOOK')
|
||||
})
|
||||
|
||||
test('syncBank: scheitert die Suche nach Vormerkungen, wird im Speicher gefiltert und der Abruf endet trotzdem ok', async () => {
|
||||
await reset({ transactions: [...nine(), raw({ ref: 'p1', date: '2026-09-30', amount: '12.00', name: 'VORGEMERKT', status: 'PDNG' })] })
|
||||
await connect()
|
||||
assert.equal((await syncBank({ now: NOW })).neu, 10)
|
||||
assert.equal(txDocs().get(docId('p1')).status, 'PDNG')
|
||||
|
||||
// die Bank nennt die Vormerkung nicht mehr; die Suche nach status=PDNG (erste Lese-Anfrage an bankTransactions) scheitert
|
||||
fake.transactions.set(ACCOUNT, nine())
|
||||
aw.failNext({ collection: config.collections.bankTransactions, method: 'GET', status: 400, message: 'Nachbau: Index status fehlt' })
|
||||
const result = await syncBank({ now: NOW })
|
||||
assert.deepEqual(result, { ok: true, neu: 0, aktualisiert: 9, geloescht: 1 })
|
||||
assert.equal(txDocs().has(docId('p1')), false)
|
||||
assert.equal(txDocs().size, 9)
|
||||
assert.equal(connection().lastSyncOk, true)
|
||||
assert.equal(connection().lastError, '')
|
||||
})
|
||||
|
||||
test('syncBank: Vormerkungen vor dem Abrufzeitraum bleiben, gebuchte Dokumente werden nie gelöscht', async () => {
|
||||
await reset()
|
||||
await connect()
|
||||
|
||||
Reference in new issue
Block a user