File

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

Index

Properties

Properties

Optional assignedToId
Type : string
Decorators :
@ApiPropertyOptional()
@IsOptional()
@IsString()
Optional entityId
Type : string
Decorators :
@ApiPropertyOptional()
@IsOptional()
@IsString()
Optional entityType
Type : string
Decorators :
@ApiPropertyOptional()
@IsOptional()
@IsString()
message
Type : string
Decorators :
@ApiProperty({example: 'Vehicle TRK-001 is 30 minutes behind schedule'})
@IsString()
@IsNotEmpty()
severity
Type : AlertSeverity
Decorators :
@ApiProperty({enum: AlertSeverity})
@IsEnum(AlertSeverity)
title
Type : string
Decorators :
@ApiProperty({example: 'Vehicle delay detected'})
@IsString()
@IsNotEmpty()
import { IsNotEmpty, IsString, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { AlertSeverity } from '@prisma/client';

export class CreateAlertDto {
  @ApiProperty({ enum: AlertSeverity })
  @IsEnum(AlertSeverity)
  severity: AlertSeverity;

  @ApiProperty({ example: 'Vehicle delay detected' })
  @IsString()
  @IsNotEmpty()
  title: string;

  @ApiProperty({ example: 'Vehicle TRK-001 is 30 minutes behind schedule' })
  @IsString()
  @IsNotEmpty()
  message: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  entityType?: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  entityId?: string;

  @ApiPropertyOptional()
  @IsOptional()
  @IsString()
  assignedToId?: string;
}

results matching ""

    No results matching ""