refactor: changed notif entity and createDTO
This commit is contained in:
@@ -27,13 +27,11 @@ export class CreateNotificationDto {
|
||||
description: 'notification subject'
|
||||
})
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
subject: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'notification message'
|
||||
})
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
message: string;
|
||||
}
|
||||
@@ -6,7 +6,8 @@ import { Column, Entity, ManyToOne } from "typeorm";
|
||||
@Entity('notifications')
|
||||
export class AppNotification extends BaseEntity {
|
||||
@Column({
|
||||
type: 'boolean'
|
||||
type: 'boolean',
|
||||
default: false
|
||||
})
|
||||
isRead: boolean;
|
||||
|
||||
|
||||
@@ -9,9 +9,12 @@ import { HttpModule } from '@nestjs/axios';
|
||||
import { NotificationController } from './notification.controller';
|
||||
import { NotificationService } from './providers/notification.service';
|
||||
import { NotificationRepository } from './repositories/notification.repository';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { AppNotification } from './entities/notification.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([AppNotification]),
|
||||
HttpModule,
|
||||
BullModule.registerQueue({
|
||||
name: SMS_QUEUE,
|
||||
|
||||
@@ -6,6 +6,4 @@ export class NotificationService {
|
||||
constructor(
|
||||
private readonly notifRepository: NotificationRepository
|
||||
) {}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user