update notif
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
import { IsNotEmpty, IsEnum } from 'class-validator';
|
||||
import { IsNotEmpty, IsEnum, IsArray } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { NotifTitleEnum } from '../interfaces/notification.interface';
|
||||
import { NotificationType } from '../interfaces/notification.interface';
|
||||
import { NotifChannelEnum } from '../interfaces/notification.interface';
|
||||
|
||||
export class CreatePreferenceDto {
|
||||
@ApiProperty({
|
||||
description: 'Notification type (SMS, PUSH, BOTH, or NONE)',
|
||||
enum: NotificationType,
|
||||
example: NotificationType.SMS,
|
||||
})
|
||||
@IsEnum(NotificationType)
|
||||
@IsNotEmpty()
|
||||
notificationType!: NotificationType;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Notification title/type (e.g., order.created, review.created)',
|
||||
enum: NotifTitleEnum,
|
||||
@@ -21,4 +12,13 @@ export class CreatePreferenceDto {
|
||||
@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[];
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { NotificationType } from '../interfaces/notification.interface';
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
import { IsEnum } from 'class-validator';
|
||||
import { NotifChannelEnum } from '../interfaces/notification.interface';
|
||||
import { IsArray, IsEnum } from 'class-validator';
|
||||
|
||||
export class UpdatePreferenceDto {
|
||||
@ApiProperty({
|
||||
description: 'Notification type (SMS, PUSH, BOTH, or NONE)',
|
||||
enum: NotificationType,
|
||||
example: NotificationType.SMS,
|
||||
enum: NotifChannelEnum,
|
||||
example: NotifChannelEnum.SMS,
|
||||
})
|
||||
@IsEnum(NotificationType)
|
||||
@IsNotEmpty()
|
||||
notificationType!: NotificationType;
|
||||
@IsEnum(NotifChannelEnum)
|
||||
@IsArray()
|
||||
@IsEnum(NotifChannelEnum, { each: true })
|
||||
channels!: NotifChannelEnum[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user