rework internal order system
This commit is contained in:
@@ -407,6 +407,33 @@ class AusruestungsanfrageController {
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Position delivery tracking
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
async updatePositionGeliefert(req: Request, res: Response): Promise<void> {
|
||||
try {
|
||||
const positionId = Number(req.params.positionId);
|
||||
const { geliefert } = req.body as { geliefert?: boolean };
|
||||
|
||||
if (typeof geliefert !== 'boolean') {
|
||||
res.status(400).json({ success: false, message: 'geliefert (boolean) ist erforderlich' });
|
||||
return;
|
||||
}
|
||||
|
||||
const position = await ausruestungsanfrageService.updatePositionGeliefert(positionId, geliefert);
|
||||
if (!position) {
|
||||
res.status(404).json({ success: false, message: 'Position nicht gefunden' });
|
||||
return;
|
||||
}
|
||||
|
||||
res.status(200).json({ success: true, data: position });
|
||||
} catch (error) {
|
||||
logger.error('AusruestungsanfrageController.updatePositionGeliefert error', { error });
|
||||
res.status(500).json({ success: false, message: 'Lieferstatus konnte nicht aktualisiert werden' });
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Overview
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user