new features

This commit is contained in:
Matthias Hochmeister
2026-03-23 16:47:36 +01:00
parent 8c66492b27
commit 690f260b71
9 changed files with 80 additions and 36 deletions

View File

@@ -396,8 +396,9 @@ class VehicleService {
// Auto-update next service date on the vehicle when result is 'bestanden'
if (data.ergebnis === 'bestanden' && data.naechste_faelligkeit) {
const column = data.art === '§57a Prüfung' ? 'paragraph57a_faellig_am' : 'naechste_wartung_am';
await pool.query(
`UPDATE fahrzeuge SET naechste_wartung_am = $1 WHERE id = $2`,
`UPDATE fahrzeuge SET ${column} = $1 WHERE id = $2`,
[data.naechste_faelligkeit, fahrzeugId]
);
}
@@ -443,8 +444,9 @@ class VehicleService {
// Auto-update next service date on the vehicle when result is 'bestanden'
if (data.ergebnis === 'bestanden' && data.naechste_faelligkeit) {
const column = data.art === '§57a Prüfung' ? 'paragraph57a_faellig_am' : 'naechste_wartung_am';
await pool.query(
`UPDATE fahrzeuge SET naechste_wartung_am = $1 WHERE id = $2`,
`UPDATE fahrzeuge SET ${column} = $1 WHERE id = $2`,
[data.naechste_faelligkeit, fahrzeugId]
);
}