Buchungskalender: Abschluss – S7 Buchungslink-Gueltigkeit (90 Tage nach Abreise, 30 Tage nach Absage), tokenHash beim Anonymisieren leeren

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Opus 5.5 committed 2026-10-07 15:26:12 +00:00
1 parent 17400cac1f
commit 4f9fb6b109
6 files changed
+57 -12

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ import * as mails from './mails.js'
import { berechnePreis, preiseVollstaendig, pruefePosten, summiere } from './preis.js'
import { stelleAus } from './rechnungen.js'
import { aktualisiereAnfrage, ladeAnfrage, findeRechnung, ladeEinstellungen, ladePreise, ladeRechnung, ladeUnterkunft, legeAnfrageDokAn, listeAnfragen, listeAnfragenAlle } from './speicher.js'
import { neuesToken, tokenPasst } from './token.js'
import { linkGueltig, neuesToken, tokenPasst } from './token.js'
import * as zahlung from './zahlung.js'
export const UEBERGAENGE = {
@@ -194,7 +194,7 @@ export async function bucheVerbindlich(ctx, anfrageId, token, { rechnungsadresse
if (!pre || pre.featureId !== ctx.featureId) throw new UkFehler(404, 'nicht_gefunden')
const r = await withLocks(withLocksKey(pre.unterkunftId), async () => {
const a = await ladeAnfrage(anfrageId)
if (!a || a.featureId !== ctx.featureId || !tokenPasst(a.tokenHash, token)) throw new UkFehler(404, 'nicht_gefunden')
if (!a || a.featureId !== ctx.featureId || !tokenPasst(a.tokenHash, token) || !linkGueltig(a, now)) throw new UkFehler(404, 'nicht_gefunden')
if (a.status === 'gebucht' || a.status === 'bezahlt') {
return { anfrage: a, rechnung: a.rechnungId ? await ladeRechnung(a.rechnungId) : null, neu: false }
}