add maintenance model, factory and service

This commit is contained in:
Julian Krauser 2025-05-28 22:51:17 +02:00
parent cb60d61773
commit 0f6401953f
11 changed files with 276 additions and 4 deletions

View file

@ -14,6 +14,7 @@ export default abstract class DamageReportService {
.leftJoinAndSelect("damageReport.equipment", "equipment")
.leftJoinAndSelect("damageReport.vehicle", "vehicle")
.leftJoinAndSelect("damageReport.wearable", "wearable")
.leftJoinAndSelect("damageReport.maintenance", "maintenance")
.orderBy("type", "ASC")
.getMany()
.then((res) => {
@ -32,6 +33,10 @@ export default abstract class DamageReportService {
return await dataSource
.getRepository(damageReport)
.createQueryBuilder("damageReport")
.leftJoinAndSelect("damageReport.equipment", "equipment")
.leftJoinAndSelect("damageReport.vehicle", "vehicle")
.leftJoinAndSelect("damageReport.wearable", "wearable")
.leftJoinAndSelect("damageReport.maintenance", "maintenance")
.where({ id })
.getOneOrFail()
.then((res) => {