src/alerts/dto/create-alert.dto.ts
Properties |
|
| Optional assignedToId |
Type : string
|
Decorators :
@ApiPropertyOptional()
|
|
Defined in src/alerts/dto/create-alert.dto.ts:33
|
| Optional entityId |
Type : string
|
Decorators :
@ApiPropertyOptional()
|
|
Defined in src/alerts/dto/create-alert.dto.ts:28
|
| Optional entityType |
Type : string
|
Decorators :
@ApiPropertyOptional()
|
|
Defined in src/alerts/dto/create-alert.dto.ts:23
|
| message |
Type : string
|
Decorators :
@ApiProperty({example: 'Vehicle TRK-001 is 30 minutes behind schedule'})
|
|
Defined in src/alerts/dto/create-alert.dto.ts:18
|
| severity |
Type : AlertSeverity
|
Decorators :
@ApiProperty({enum: AlertSeverity})
|
|
Defined in src/alerts/dto/create-alert.dto.ts:8
|
| title |
Type : string
|
Decorators :
@ApiProperty({example: 'Vehicle delay detected'})
|
|
Defined in src/alerts/dto/create-alert.dto.ts:13
|
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;
}