diff --git a/apps/backend/src/app/alerting/alerting.service.ts b/apps/backend/src/app/alerting/alerting.service.ts index ba6a7f7..c5f3ef8 100644 --- a/apps/backend/src/app/alerting/alerting.service.ts +++ b/apps/backend/src/app/alerting/alerting.service.ts @@ -19,12 +19,13 @@ export class AlertingService { const alert = new AlertEntity(); alert.type = createAlertDto.type; - alert.value = createAlertDto.value; - alert.referenceValue = createAlertDto.referenceValue; + alert.value = Math.floor(createAlertDto.value); + alert.referenceValue = Math.floor(createAlertDto.referenceValue); const backupDataEntity = await this.backupDataService.findOneById( createAlertDto.backupId ); if (!backupDataEntity) { + console.log(`Backup with id ${createAlertDto.backupId} not found`); throw new NotFoundException( `Backup with id ${createAlertDto.backupId} not found` ); diff --git a/apps/backend/src/app/backupData/backupData.service.ts b/apps/backend/src/app/backupData/backupData.service.ts index 7338d3b..810273b 100644 --- a/apps/backend/src/app/backupData/backupData.service.ts +++ b/apps/backend/src/app/backupData/backupData.service.ts @@ -56,7 +56,10 @@ export class BackupDataService extends PaginationService { async create( createBackupDataDto: CreateBackupDataDto ): Promise { - return await this.backupDataRepository.save(createBackupDataDto); + return await this.backupDataRepository.save({ + ...createBackupDataDto, + sizeMB: Math.floor(createBackupDataDto.sizeMB), + }); } /** @@ -66,7 +69,12 @@ export class BackupDataService extends PaginationService { async createBatched( createBackupDataDtos: CreateBackupDataDto[] ): Promise { - await this.backupDataRepository.save(createBackupDataDtos); + await this.backupDataRepository.save( + createBackupDataDtos.map((dto) => ({ + ...dto, + sizeMB: Math.floor(dto.sizeMB), + })) + ); } /** @@ -95,7 +103,7 @@ export class BackupDataService extends PaginationService { from.setHours(0); from.setMinutes(0); from.setSeconds(0); - from.setMilliseconds(0) + from.setMilliseconds(0); console.log(from); } if (backupDataFilterDto.toDate) {