refactor: changed notif entity and createDTO

This commit is contained in:
2026-08-01 00:20:59 +03:30
parent 13d41ed0ac
commit 366ab5092e
4 changed files with 5 additions and 5 deletions
@@ -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
) {} ) {}
} }