mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
Compare commits
1 Commits
ef21b589c0
...
task/curat
Author | SHA1 | Date | |
---|---|---|---|
f0b472d7b0 |
@ -15,6 +15,7 @@ export enum ProductType {
|
|||||||
WL = 'WL',
|
WL = 'WL',
|
||||||
GD = 'GD',
|
GD = 'GD',
|
||||||
CUR = 'CUR',
|
CUR = 'CUR',
|
||||||
|
CUR_2 = 'CUR_2',
|
||||||
PC = 'PC',
|
PC = 'PC',
|
||||||
FOUR_S = '4S',
|
FOUR_S = '4S',
|
||||||
SIX_S = '6S',
|
SIX_S = '6S',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Injectable, HttpException, HttpStatus } from '@nestjs/common';
|
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||||
import { TuyaContext } from '@tuya/tuya-connector-nodejs';
|
|
||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
|
import { TuyaContext } from '@tuya/tuya-connector-nodejs';
|
||||||
import {
|
import {
|
||||||
AddScheduleDto,
|
AddScheduleDto,
|
||||||
EnableScheduleDto,
|
EnableScheduleDto,
|
||||||
@ -11,14 +11,14 @@ import {
|
|||||||
getDeviceScheduleInterface,
|
getDeviceScheduleInterface,
|
||||||
} from '../interfaces/get.schedule.interface';
|
} 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 { ProductType } from '@app/common/constants/product-type.enum';
|
||||||
|
import { convertKeysToCamelCase } from '@app/common/helper/camelCaseConverter';
|
||||||
import { convertTimestampToDubaiTime } from '@app/common/helper/convertTimestampToDubaiTime';
|
import { convertTimestampToDubaiTime } from '@app/common/helper/convertTimestampToDubaiTime';
|
||||||
import {
|
import {
|
||||||
getEnabledDays,
|
getEnabledDays,
|
||||||
getScheduleStatus,
|
getScheduleStatus,
|
||||||
} from '@app/common/helper/getScheduleStatus';
|
} from '@app/common/helper/getScheduleStatus';
|
||||||
|
import { DeviceRepository } from '@app/common/modules/device/repositories';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ScheduleService {
|
export class ScheduleService {
|
||||||
@ -57,7 +57,8 @@ export class ScheduleService {
|
|||||||
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.THREE_3TG &&
|
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(
|
throw new HttpException(
|
||||||
'This device is not supported for schedule',
|
'This device is not supported for schedule',
|
||||||
@ -115,7 +116,8 @@ export class ScheduleService {
|
|||||||
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.THREE_3TG &&
|
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(
|
throw new HttpException(
|
||||||
'This device is not supported for schedule',
|
'This device is not supported for schedule',
|
||||||
@ -169,7 +171,8 @@ export class ScheduleService {
|
|||||||
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.THREE_3TG &&
|
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(
|
throw new HttpException(
|
||||||
'This device is not supported for schedule',
|
'This device is not supported for schedule',
|
||||||
@ -237,7 +240,8 @@ export class ScheduleService {
|
|||||||
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.THREE_3TG &&
|
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(
|
throw new HttpException(
|
||||||
'This device is not supported for schedule',
|
'This device is not supported for schedule',
|
||||||
@ -323,7 +327,8 @@ export class ScheduleService {
|
|||||||
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
deviceDetails.productDevice.prodType !== ProductType.ONE_1TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
deviceDetails.productDevice.prodType !== ProductType.TWO_2TG &&
|
||||||
deviceDetails.productDevice.prodType !== ProductType.THREE_3TG &&
|
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(
|
throw new HttpException(
|
||||||
'This device is not supported for schedule',
|
'This device is not supported for schedule',
|
||||||
|
Reference in New Issue
Block a user