new features

This commit is contained in:
Matthias Hochmeister
2026-03-23 14:08:01 +01:00
parent 3326156b15
commit 1d011ec2df
6 changed files with 22 additions and 27 deletions

View File

@@ -364,7 +364,7 @@ class BestellungController {
res.status(400).json({ success: false, message: 'Ungültige Bestellungs-ID' });
return;
}
const { nachricht, faellig_am } = req.body;
const { faellig_am } = req.body;
if (!faellig_am) {
res.status(400).json({ success: false, message: 'Fälligkeitsdatum ist erforderlich' });
return;

View File

@@ -394,7 +394,8 @@ class EquipmentController {
async getStatusHistory(req: Request, res: Response): Promise<void> {
try {
const history = await equipmentService.getStatusHistory(req.params.id);
const { id } = req.params as Record<string, string>;
const history = await equipmentService.getStatusHistory(id);
res.status(200).json({ success: true, data: history });
} catch (error) {
logger.error('getStatusHistory error', { error, id: req.params.id });
@@ -403,8 +404,9 @@ class EquipmentController {
}
async uploadWartungFile(req: Request, res: Response): Promise<void> {
const wartungId = parseInt(req.params.wartungId, 10);
if (isNaN(wartungId)) {
const { wartungId } = req.params as Record<string, string>;
const id = parseInt(wartungId, 10);
if (isNaN(id)) {
res.status(400).json({ success: false, message: 'Ungültige Wartungs-ID' });
return;
}
@@ -414,7 +416,7 @@ class EquipmentController {
return;
}
try {
const result = await equipmentService.updateWartungslogFile(wartungId, file.path);
const result = await equipmentService.updateWartungslogFile(id, file.path);
res.status(200).json({ success: true, data: result });
} catch (error) {
logger.error('uploadWartungFile error', { error, wartungId });

View File

@@ -375,7 +375,8 @@ class VehicleController {
async getStatusHistory(req: Request, res: Response): Promise<void> {
try {
const history = await vehicleService.getStatusHistory(req.params.id);
const { id } = req.params as Record<string, string>;
const history = await vehicleService.getStatusHistory(id);
res.status(200).json({ success: true, data: history });
} catch (error) {
logger.error('getStatusHistory error', { error, id: req.params.id });
@@ -384,8 +385,9 @@ class VehicleController {
}
async uploadWartungFile(req: Request, res: Response): Promise<void> {
const wartungId = parseInt(req.params.wartungId, 10);
if (isNaN(wartungId)) {
const { wartungId } = req.params as Record<string, string>;
const id = parseInt(wartungId, 10);
if (isNaN(id)) {
res.status(400).json({ success: false, message: 'Ungültige Wartungs-ID' });
return;
}
@@ -395,7 +397,7 @@ class VehicleController {
return;
}
try {
const result = await vehicleService.updateWartungslogFile(wartungId, file.path);
const result = await vehicleService.updateWartungslogFile(id, file.path);
res.status(200).json({ success: true, data: result });
} catch (error) {
logger.error('uploadWartungFile error', { error, wartungId });