added contract history

This commit is contained in:
2026-02-08 19:24:37 +01:00
parent ee4f1aacdd
commit e348e86c60
33 changed files with 3200 additions and 743 deletions
@@ -0,0 +1,39 @@
import { Router } from 'express';
import * as contractHistoryController from '../controllers/contractHistory.controller.js';
import { authenticate, requirePermission } from '../middleware/auth.js';
const router = Router();
// Alle Einträge für einen Vertrag
router.get(
'/contracts/:contractId/history',
authenticate,
requirePermission('contracts:read'),
contractHistoryController.getHistoryEntries
);
// Neuen Eintrag erstellen
router.post(
'/contracts/:contractId/history',
authenticate,
requirePermission('contracts:update'),
contractHistoryController.createHistoryEntry
);
// Eintrag aktualisieren
router.put(
'/contracts/:contractId/history/:entryId',
authenticate,
requirePermission('contracts:update'),
contractHistoryController.updateHistoryEntry
);
// Eintrag löschen
router.delete(
'/contracts/:contractId/history/:entryId',
authenticate,
requirePermission('contracts:update'),
contractHistoryController.deleteHistoryEntry
);
export default router;