From 026e47cd1b9981c5e61834c4694788cda7866512 Mon Sep 17 00:00:00 2001 From: Bastian Wagner Date: Fri, 27 Feb 2026 15:11:12 +0100 Subject: [PATCH] docs --- api/src/modules/system/system.service.ts | 2 -- api/src/shared/service/activity.logger.service.ts | 6 +++--- api/src/shared/service/system.helper.service.ts | 12 +++++++++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/api/src/modules/system/system.service.ts b/api/src/modules/system/system.service.ts index ce32beb..06c2f66 100644 --- a/api/src/modules/system/system.service.ts +++ b/api/src/modules/system/system.service.ts @@ -13,7 +13,6 @@ export class SystemService { constructor( private systemRepo: KeySystemRepository, private userRepo: UserRepository, - // private systemActivityRepo: ActivityRepository, private mailService: MailService, private readonly configService: ConfigService, private readonly activityService: ActivityHelperService @@ -66,7 +65,6 @@ export class SystemService { return this.systemRepo.findOne({ where: { id: id } }); } - // eslint-disable-next-line @typescript-eslint/no-unused-vars async update(user: User, updateSystemDto: UpdateSystemDto) { if (!user || !user.id || !updateSystemDto.id) { throw new HttpException('forbidden', HttpStatus.FORBIDDEN); } const system = await this.systemRepo.findOne({ where: { id: updateSystemDto.id, managers: { id: user.id } }, withDeleted: true }); diff --git a/api/src/shared/service/activity.logger.service.ts b/api/src/shared/service/activity.logger.service.ts index 4f5ab90..bc2e6c5 100644 --- a/api/src/shared/service/activity.logger.service.ts +++ b/api/src/shared/service/activity.logger.service.ts @@ -130,7 +130,7 @@ export class ActivityHelperService { async logCylinderRestored(user: User, cylinder: Cylinder) { let msg = `Zylinder ${cylinder.name} wiederhergestellt`; - const system: KeySystem = await this.helper.getSystemOCylinder(cylinder); + const system: KeySystem = await this.helper.getSystemOfCylinder(cylinder); this.activityRepo.save( this.activityRepo.create({ @@ -142,7 +142,7 @@ export class ActivityHelperService { async logCylinderCreated(user: User, cylinder: Cylinder) { const msg = `Zylinder ${cylinder.name} angelegt`; - const system: KeySystem = await this.helper.getSystemOCylinder(cylinder); + const system: KeySystem = await this.helper.getSystemOfCylinder(cylinder); this.activityRepo.save( this.activityRepo.create({ system, @@ -154,7 +154,7 @@ export class ActivityHelperService { async logCylinderDeleted(user: User, cylinder: Cylinder) { let msg = `Zylinder ${cylinder.name} gelöscht`; - const system: KeySystem = await this.helper.getSystemOCylinder(cylinder); + const system: KeySystem = await this.helper.getSystemOfCylinder(cylinder); this.activityRepo.save( this.activityRepo.create({ diff --git a/api/src/shared/service/system.helper.service.ts b/api/src/shared/service/system.helper.service.ts index 951fa30..57cbd00 100644 --- a/api/src/shared/service/system.helper.service.ts +++ b/api/src/shared/service/system.helper.service.ts @@ -39,6 +39,11 @@ export class HelperService { return keys; } + /** + * Sucht das System eines Schlüssels und gibt es als Promise zurück + * @param key key + * @returns system: KeySystem + */ async getSystemOfKey(key: Key): Promise { const k = await this.keyRepo.findOne({ where: { id: key.id }, @@ -50,7 +55,12 @@ export class HelperService { return found.system; } - async getSystemOCylinder(cylinder: Cylinder): Promise { + /** + * Gibt das System eines Zylinders und gibt es als Promise zurück + * @param cylinder Zylinder + * @returns Promise + */ + async getSystemOfCylinder(cylinder: Cylinder): Promise { const k = await this.cylinderRepository.findOne({ where: { id: cylinder.id }, relations: ['system'],