feat: added create and update dto for notification
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
import { ApiProperty } from "@nestjs/swagger";
|
||||||
|
import { IsBoolean, IsNotEmpty, IsOptional, IsString, IsUUID } from "class-validator";
|
||||||
|
|
||||||
|
export class CreateNotificationDto {
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'Id of the receiver user'
|
||||||
|
})
|
||||||
|
@IsUUID()
|
||||||
|
@IsNotEmpty()
|
||||||
|
userId: string;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'Id of the sender organization'
|
||||||
|
})
|
||||||
|
@IsUUID()
|
||||||
|
@IsNotEmpty()
|
||||||
|
organId: string;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'whether the notif is read or not'
|
||||||
|
})
|
||||||
|
@IsBoolean()
|
||||||
|
@IsOptional()
|
||||||
|
isRead: boolean;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'notification subject'
|
||||||
|
})
|
||||||
|
@IsString()
|
||||||
|
@IsOptional()
|
||||||
|
subject: string;
|
||||||
|
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'notification message'
|
||||||
|
})
|
||||||
|
@IsString()
|
||||||
|
@IsOptional()
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { PartialType } from "@nestjs/swagger";
|
||||||
|
import { CreateNotificationDto } from "./create-notification.dto";
|
||||||
|
|
||||||
|
export class UpdateNotificationDto extends PartialType(CreateNotificationDto) {}
|
||||||
@@ -8,6 +8,7 @@ import { smsConfigsProvider } from 'src/config/sms.config';
|
|||||||
import { HttpModule } from '@nestjs/axios';
|
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';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -23,6 +24,7 @@ import { NotificationService } from './providers/notification.service';
|
|||||||
SmsProducer,
|
SmsProducer,
|
||||||
SmsProcessor,
|
SmsProcessor,
|
||||||
NotificationService,
|
NotificationService,
|
||||||
|
NotificationRepository
|
||||||
],
|
],
|
||||||
exports: [SmsProducer, SMS_CONFIG, NotificationService],
|
exports: [SmsProducer, SMS_CONFIG, NotificationService],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
import { Injectable } from "@nestjs/common";
|
import { Injectable } from "@nestjs/common";
|
||||||
|
import { NotificationRepository } from "../repositories/notification.repository";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class NotificationService {}
|
export class NotificationService {
|
||||||
|
constructor(
|
||||||
|
private readonly notifRepository: NotificationRepository
|
||||||
|
) {}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user