diff --git a/libs/common/src/constants/product-type.enum.ts b/libs/common/src/constants/product-type.enum.ts index 1bb1394..182f43c 100644 --- a/libs/common/src/constants/product-type.enum.ts +++ b/libs/common/src/constants/product-type.enum.ts @@ -15,6 +15,7 @@ export enum ProductType { WL = 'WL', GD = 'GD', CUR = 'CUR', + CUR_2 = 'CUR_2', PC = 'PC', FOUR_S = '4S', SIX_S = '6S', diff --git a/src/schedule/services/schedule.service.ts b/src/schedule/services/schedule.service.ts index ee029cf..065dc55 100644 --- a/src/schedule/services/schedule.service.ts +++ b/src/schedule/services/schedule.service.ts @@ -1,6 +1,6 @@ -import { Injectable, HttpException, HttpStatus } from '@nestjs/common'; -import { TuyaContext } from '@tuya/tuya-connector-nodejs'; +import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; +import { TuyaContext } from '@tuya/tuya-connector-nodejs'; import { AddScheduleDto, EnableScheduleDto, @@ -11,14 +11,14 @@ import { getDeviceScheduleInterface, } from '../interfaces/get.schedule.interface'; -import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter'; -import { DeviceRepository } from '@app/common/modules/device/repositories'; import { ProductType } from '@app/common/constants/product-type.enum'; +import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter'; import { convertTimestampToDubaiTime } from '@app/common/helper/convertTimestampToDubaiTime'; import { getEnabledDays, getScheduleStatus, } from '@app/common/helper/getScheduleStatus'; +import { DeviceRepository } from '@app/common/modules/device/repositories'; @Injectable() export class ScheduleService { @@ -57,7 +57,8 @@ export class ScheduleService { deviceDetails.productDevice.prodType !== ProductType.ONE_1TG && deviceDetails.productDevice.prodType !== ProductType.TWO_2TG && deviceDetails.productDevice.prodType !== ProductType.THREE_3TG && - deviceDetails.productDevice.prodType !== ProductType.GD + deviceDetails.productDevice.prodType !== ProductType.GD && + deviceDetails.productDevice.prodType !== ProductType.CUR_2 ) { throw new HttpException( 'This device is not supported for schedule', @@ -115,7 +116,8 @@ export class ScheduleService { deviceDetails.productDevice.prodType !== ProductType.ONE_1TG && deviceDetails.productDevice.prodType !== ProductType.TWO_2TG && deviceDetails.productDevice.prodType !== ProductType.THREE_3TG && - deviceDetails.productDevice.prodType !== ProductType.GD + deviceDetails.productDevice.prodType !== ProductType.GD && + deviceDetails.productDevice.prodType !== ProductType.CUR_2 ) { throw new HttpException( 'This device is not supported for schedule', @@ -169,7 +171,8 @@ export class ScheduleService { deviceDetails.productDevice.prodType !== ProductType.ONE_1TG && deviceDetails.productDevice.prodType !== ProductType.TWO_2TG && deviceDetails.productDevice.prodType !== ProductType.THREE_3TG && - deviceDetails.productDevice.prodType !== ProductType.GD + deviceDetails.productDevice.prodType !== ProductType.GD && + deviceDetails.productDevice.prodType !== ProductType.CUR_2 ) { throw new HttpException( 'This device is not supported for schedule', @@ -237,7 +240,8 @@ export class ScheduleService { deviceDetails.productDevice.prodType !== ProductType.ONE_1TG && deviceDetails.productDevice.prodType !== ProductType.TWO_2TG && deviceDetails.productDevice.prodType !== ProductType.THREE_3TG && - deviceDetails.productDevice.prodType !== ProductType.GD + deviceDetails.productDevice.prodType !== ProductType.GD && + deviceDetails.productDevice.prodType !== ProductType.CUR_2 ) { throw new HttpException( 'This device is not supported for schedule', @@ -323,7 +327,8 @@ export class ScheduleService { deviceDetails.productDevice.prodType !== ProductType.ONE_1TG && deviceDetails.productDevice.prodType !== ProductType.TWO_2TG && deviceDetails.productDevice.prodType !== ProductType.THREE_3TG && - deviceDetails.productDevice.prodType !== ProductType.GD + deviceDetails.productDevice.prodType !== ProductType.GD && + deviceDetails.productDevice.prodType !== ProductType.CUR_2 ) { throw new HttpException( 'This device is not supported for schedule',