Files
lcbp3/backend/src/modules/notification/dto/create-notification.dto.ts
T
admin 11984bfa29
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s
260322:1648 Correct Coresspondence / Doing RFA / Correct CI
2026-03-22 16:48:12 +07:00

40 lines
801 B
TypeScript

import {
IsString,
IsInt,
IsOptional,
IsEnum,
IsNotEmpty,
_IsUrl,
} from 'class-validator';
import { NotificationType } from '../entities/notification.entity';
export class CreateNotificationDto {
@IsInt()
@IsNotEmpty()
userId!: number; // ผู้รับ
@IsString()
@IsNotEmpty()
title!: string; // หัวข้อ
@IsString()
@IsNotEmpty()
message!: string; // ข้อความ
@IsEnum(NotificationType)
@IsNotEmpty()
type!: NotificationType; // ประเภท: EMAIL, LINE, SYSTEM
@IsString()
@IsOptional()
entityType?: string; // e.g., 'rfa', 'correspondence'
@IsInt()
@IsOptional()
entityId?: number; // e.g., rfa_id
@IsString()
@IsOptional()
link?: string; // Link ไปยังหน้าเว็บ (Frontend)
}