Files
negareh-api/src/modules/notification/dto/create-notification.dto.ts
T
2026-01-07 12:24:55 +03:30

41 lines
1009 B
TypeScript

import { IsString, IsNotEmpty, IsOptional, IsArray, IsObject } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
export class CreateNotificationDto {
@ApiProperty({ description: 'Notification title' })
@IsString()
@IsNotEmpty()
title: string;
@ApiProperty({ description: 'Notification message' })
@IsString()
@IsNotEmpty()
message: string;
@ApiProperty({ description: 'Notification type' })
@IsString()
@IsNotEmpty()
type: string;
@ApiPropertyOptional({ description: 'User ID' })
@IsString()
@IsOptional()
userId?: string;
@ApiPropertyOptional({ description: 'Phone number for SMS' })
@IsString()
@IsOptional()
phoneNumber?: string;
@ApiPropertyOptional({ description: 'Push notification tokens', type: [String] })
@IsArray()
@IsString({ each: true })
@IsOptional()
pushTokens?: string[];
@ApiPropertyOptional({ description: 'Additional data' })
@IsObject()
@IsOptional()
data?: Record<string, any>;
}