From aa59ab452a1f2701c03248b643a1a9b174c44f66 Mon Sep 17 00:00:00 2001 From: bernd Date: Thu, 13 Aug 2026 09:20:54 +0000 Subject: [PATCH] Replace flat trash list with a real month-calendar view (FullCalendar) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebuilds the "Müll-Kalender" as a proper color-coded FullCalendar (v6, MIT-licensed, CDN, no build step) month grid instead of a bare list of type+date rows. Adds a manual "Kalender aktualisieren" action for landlords (POST /v1/trash-schedule/sync) that re-runs the same KAW sync job as the daily cron, instead of letting them delete individual calendar entries by clicking — accidental single-click deletion of official data was too easy and had no real justification, since a missing date just gets re-added by the next sync anyway. --- backend/src/routes/storage.ts | 18 +++++ web-dashboard/index.html | 125 ++++++++++++++++++++++++++-------- 2 files changed, 116 insertions(+), 27 deletions(-) diff --git a/backend/src/routes/storage.ts b/backend/src/routes/storage.ts index 9804f3a..18159f9 100644 --- a/backend/src/routes/storage.ts +++ b/backend/src/routes/storage.ts @@ -1,6 +1,7 @@ import { Router, Response } from 'express'; import { PrismaClient, StorageLocation, TrashType } from '@prisma/client'; import { AuthedRequest, requireAuth, requireRole } from '../middleware/auth'; +import { runTrashCalendarSyncJob } from '../jobs/trashCalendarSyncJob'; const prisma = new PrismaClient(); @@ -158,3 +159,20 @@ storageRouter.delete( } }, ); + +// Manuelles Nachladen der amtlichen Nackenheim-Termine (dieselbe Quelle wie +// der tägliche Host-Cron, siehe jobs/trashCalendarSyncJob.ts) — für den Fall, +// dass der Vermieter nicht bis zum nächsten automatischen Lauf warten will. +storageRouter.post( + '/trash-schedule/sync', + requireAuth, + requireRole('LANDLORD', 'ADMIN'), + async (_req: AuthedRequest, res: Response) => { + try { + const result = await runTrashCalendarSyncJob(); + res.status(200).json(result); + } catch (err) { + res.status(502).json({ error: err instanceof Error ? err.message : 'Sync fehlgeschlagen' }); + } + }, +); diff --git a/web-dashboard/index.html b/web-dashboard/index.html index bfaef75..b64d954 100644 --- a/web-dashboard/index.html +++ b/web-dashboard/index.html @@ -4,6 +4,8 @@ WG Nackenheim — Vermieter-Cockpit + +