Update dependencies in package.json and package-lock.json, refactor CronService to include notification handling for schedule expirations, and enhance DocumentSchema with OpenAI integration for document editing suggestions. Additionally, modify GraphqlModule to include PubSubModule for real-time notifications and improve datetime utility functions for better date formatting. Update epess-database subproject reference to indicate a dirty state.
This commit is contained in:
19
src/Notification/notification.service.ts
Normal file
19
src/Notification/notification.service.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { PubSubEvent } from 'src/common/pubsub/pubsub-event'
|
||||
import { PrismaService } from 'src/Prisma/prisma.service'
|
||||
import { PubSubService } from 'src/PubSub/pubsub.service'
|
||||
|
||||
@Injectable()
|
||||
export class NotificationService {
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly pubSub: PubSubService,
|
||||
) {}
|
||||
|
||||
async sendNotification(userId: string, title: string, content: string) {
|
||||
await this.pubSub.publish(`${PubSubEvent.NOTIFICATION}.${userId}`, {
|
||||
title,
|
||||
content,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user