new features

This commit is contained in:
Matthias Hochmeister
2026-03-23 14:01:39 +01:00
parent d2dc64d54a
commit 3326156b15
35 changed files with 1341 additions and 257 deletions

View File

@@ -113,9 +113,9 @@ class BestellungController {
}
async createOrder(req: Request, res: Response): Promise<void> {
const { titel } = req.body;
if (!titel || typeof titel !== 'string' || titel.trim().length === 0) {
res.status(400).json({ success: false, message: 'Titel ist erforderlich' });
const { bezeichnung } = req.body;
if (!bezeichnung || typeof bezeichnung !== 'string' || bezeichnung.trim().length === 0) {
res.status(400).json({ success: false, message: 'Bezeichnung ist erforderlich' });
return;
}
try {
@@ -203,9 +203,9 @@ class BestellungController {
res.status(400).json({ success: false, message: 'Ungültige Bestellungs-ID' });
return;
}
const { artikel, menge } = req.body;
if (!artikel || typeof artikel !== 'string' || artikel.trim().length === 0) {
res.status(400).json({ success: false, message: 'Artikel ist erforderlich' });
const { bezeichnung, menge } = req.body;
if (!bezeichnung || typeof bezeichnung !== 'string' || bezeichnung.trim().length === 0) {
res.status(400).json({ success: false, message: 'Bezeichnung ist erforderlich' });
return;
}
if (menge === undefined || menge === null || menge <= 0) {
@@ -364,11 +364,7 @@ class BestellungController {
res.status(400).json({ success: false, message: 'Ungültige Bestellungs-ID' });
return;
}
const { titel, faellig_am } = req.body;
if (!titel || typeof titel !== 'string' || titel.trim().length === 0) {
res.status(400).json({ success: false, message: 'Titel ist erforderlich' });
return;
}
const { nachricht, faellig_am } = req.body;
if (!faellig_am) {
res.status(400).json({ success: false, message: 'Fälligkeitsdatum ist erforderlich' });
return;