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