This commit is contained in:
Matthias Hochmeister
2026-03-14 14:10:05 +01:00
parent 992ca8e104
commit 8d03c13bee
7 changed files with 227 additions and 10 deletions

View File

@@ -683,6 +683,25 @@ class MemberService {
return [];
}
}
/**
* Returns all Ausbildungen (training courses) for a given user from the FDISK-synced table.
*/
async getAusbildungen(userId: string): Promise<any[]> {
try {
const result = await pool.query(
`SELECT id, kursname, kurs_datum, ablaufdatum, ort, bemerkung, status, created_at
FROM ausbildung
WHERE user_id = $1
ORDER BY kurs_datum DESC NULLS LAST, created_at DESC`,
[userId]
);
return result.rows;
} catch (error) {
logger.error('Error fetching Ausbildungen', { error, userId });
return [];
}
}
}
export default new MemberService();