25 lines
774 B
TypeScript
25 lines
774 B
TypeScript
import { IsNotEmpty, IsEnum, IsArray } from 'class-validator';
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
import { NotifTitleEnum } from '../interfaces/notification.interface';
|
|
import { NotifChannelEnum } from '../interfaces/notification.interface';
|
|
|
|
export class CreatePreferenceDto {
|
|
@ApiProperty({
|
|
description: 'Notification title/type (e.g., order.created, review.created)',
|
|
enum: NotifTitleEnum,
|
|
example: NotifTitleEnum.ORDER_CREATED,
|
|
})
|
|
@IsEnum(NotifTitleEnum)
|
|
@IsNotEmpty()
|
|
title!: NotifTitleEnum;
|
|
|
|
@ApiProperty({
|
|
description: 'Notification type (SMS, PUSH, BOTH, or NONE)',
|
|
enum: NotifChannelEnum,
|
|
example: NotifChannelEnum.SMS,
|
|
})
|
|
@IsArray()
|
|
@IsEnum(NotifChannelEnum, { each: true })
|
|
channels!: NotifChannelEnum[];
|
|
}
|