File

src/alert/dto/update-alert.dto.ts

Index

Properties

Properties

Optional alertParams
Type : AlertParams
Decorators :
@IsOptional()
@ApiProperty({required: false})
Optional interval
Type : number
Decorators :
@IsOptional()
@IsNumber()
@ApiProperty({required: false})
Optional name
Type : string
Decorators :
@IsOptional()
@IsString()
@ApiProperty({required: false})
Optional status
Type : AlertStatus
Decorators :
@IsOptional()
@IsEnum(AlertStatus, {each: true})
@NotEquals(AlertStatus.INPROGRESS)
@NotEquals(AlertStatus.TRIGGERED)
type
Type : AlertType
Decorators :
@IsOptional()
@ApiProperty({required: false})
@IsEnum(AlertType, {each: true})
import { ApiProperty } from "@nestjs/swagger";
import {
  IsEnum,
  IsNumber,
  IsOptional,
  IsString,
  NotEquals,
} from "class-validator";
import { AlertStatus, AlertType } from "../entities/alert.entity";
import { AlertParams } from "../types/alert-params.type";

export class UpdateAlertDto {
  @IsOptional()
  @IsString()
  @ApiProperty({ required: false })
  name?: string;

  @IsOptional()
  @IsNumber()
  @ApiProperty({ required: false })
  interval?: number;

  @IsOptional()
  @IsEnum(AlertStatus, { each: true })
  @NotEquals(AlertStatus.INPROGRESS)
  @NotEquals(AlertStatus.TRIGGERED)
  status?: AlertStatus;

  @IsOptional()
  @ApiProperty({ required: false })
  alertParams?: AlertParams;

  @IsOptional()
  @ApiProperty({ required: false })
  @IsEnum(AlertType, { each: true })
  type: AlertType;
}

results matching ""

    No results matching ""