Buchungskalender: Abschluss – S6 Belegung laedt nur Relevantes, bis-Indizes, 10-s-Speicher

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
knsoandClaude Opus 5.5 committed 2026-10-07 15:25:17 +00:00
1 parent ab838d07bc
commit 17400cac1f
7 files changed
+99 -17

No files matched your search

+3 -2
View File
@@ -15,10 +15,11 @@ export async function belegteBereiche(unterkunftId, von, bis, { ohneAnfrage, now
const jetzt = now instanceof Date ? now.getTime() : now
const fenster = { von, bis }
const roh = []
for (const s of await listeSperren(unterkunftId)) {
// nur was nach dem Fensteranfang endet (Index auf bis): alles andere kann das Fenster nicht beruehren
for (const s of await listeSperren(unterkunftId, { bisNach: von })) {
roh.push({ von: s.von, bis: s.bis, quelle: String(s.quelle ?? '').startsWith('ical') ? 'ical' : 'manuell' })
}
for (const a of await listeAnfragenNachStatus(unterkunftId, [...AKTIVE_STATUS, 'freigegeben'])) {
for (const a of await listeAnfragenNachStatus(unterkunftId, [...AKTIVE_STATUS, 'freigegeben'], { bisNach: von })) {
if (ohneAnfrage && a.$id === ohneAnfrage) continue
if (a.status === 'freigegeben') {
const frist = Date.parse(a.fristAt)