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:
2024-11-30 16:41:47 +07:00
parent 7cff5069de
commit a619c95efc
17 changed files with 971 additions and 863 deletions

View 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,
})
}
}