notification module refactor
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
import { IsNotEmpty, IsEnum } from 'class-validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { NotificationTitle } from '../entities/notification.entity';
|
||||
import { NotificationTitleEnum } from '../interfaces/notification.interface';
|
||||
import { NotificationType } from '../interfaces/notification.interface';
|
||||
|
||||
export class CreatePreferenceDto {
|
||||
@ApiProperty({
|
||||
@ApiProperty({
|
||||
description: 'Notification type (SMS, PUSH, BOTH, or NONE)',
|
||||
enum: NotificationType,
|
||||
example: NotificationType.SMS
|
||||
example: NotificationType.SMS,
|
||||
})
|
||||
@IsEnum(NotificationType)
|
||||
@IsNotEmpty()
|
||||
notificationType!: NotificationType;
|
||||
|
||||
@ApiProperty({
|
||||
@ApiProperty({
|
||||
description: 'Notification title/type (e.g., order.created, review.created)',
|
||||
enum: NotificationTitle,
|
||||
example: NotificationTitle.ORDER_CREATED
|
||||
enum: NotificationTitleEnum,
|
||||
example: NotificationTitleEnum.ORDER_CREATED,
|
||||
})
|
||||
@IsEnum(NotificationTitle)
|
||||
@IsEnum(NotificationTitleEnum)
|
||||
@IsNotEmpty()
|
||||
title!: NotificationTitle;
|
||||
title!: NotificationTitleEnum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user