import { TimeZoneRepository } from '@app/common/modules/timezone/repositories'; import { BadRequestException, HttpException, HttpStatus, Injectable, } from '@nestjs/common'; @Injectable() export class TimeZoneService { constructor(private readonly timeZoneRepository: TimeZoneRepository) {} async getAllTimeZones() { try { const timeZones = await this.timeZoneRepository.find(); return timeZones; } catch (err) { if (err instanceof BadRequestException) { throw err; // Re-throw BadRequestException } else { throw new HttpException('TimeZones found', HttpStatus.NOT_FOUND); } } } }