File

src/alert/dto/create-alert.dto.ts

Index

Properties

Properties

alertParams
Type : AlertParams
Decorators :
@IsNotEmpty()
@ApiProperty({required: true})
category
Type : AlertCategory
Decorators :
@IsNotEmpty()
@IsEnum(AlertCategory, {each: true})
interval
Type : number
Decorators :
@IsNotEmpty()
@IsNumber()
@ApiProperty({required: true})
name
Type : string
Decorators :
@IsNotEmpty()
@IsString()
@ApiProperty({required: true})
projectId
Type : number
Decorators :
@IsNotEmpty()
@IsNumber()
@ApiProperty({required: true})
targetFilter
Type : AlertTarget
Decorators :
@IsNotEmpty()
@ApiProperty({required: true})
type
Type : AlertType
Decorators :
@IsNotEmpty()
@IsEnum(AlertType, {each: true})
import { ApiProperty } from "@nestjs/swagger";
import { IsEnum, IsNotEmpty, IsNumber, IsString } from "class-validator";
import { AlertCategory, AlertType } from "../entities/alert.entity";
import { AlertTarget } from "../types/alertTargets/alert-target.type";
import { AlertParams } from "../types/alert-params.type";

export class CreateAlertDto {
  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true })
  name: string;

  @IsNotEmpty()
  @IsNumber()
  @ApiProperty({ required: true })
  projectId: number;

  @IsNotEmpty()
  @IsEnum(AlertCategory, { each: true })
  category: AlertCategory;

  @IsNotEmpty()
  @IsEnum(AlertType, { each: true })
  type: AlertType;

  @IsNotEmpty()
  @IsNumber()
  @ApiProperty({ required: true })
  interval: number;

  @IsNotEmpty()
  @ApiProperty({ required: true })
  targetFilter: AlertTarget;

  @IsNotEmpty()
  @ApiProperty({ required: true })
  alertParams: AlertParams;
}

results matching ""

    No results matching ""