add alert routes

This commit is contained in:
2025-06-21 12:29:53 +05:30
parent c6bb01d8e4
commit e821c8d11d
12 changed files with 336 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
import { EventEmitter } from "stream";
import { Claim } from "./utils/claims";
export type ChangeEvent = {
type: "insert" | "update" | "delete";
@@ -7,4 +6,18 @@ export type ChangeEvent = {
document?: Object;
};
export type AlertEvent = {
type: "insert";
collection: "alerts";
document: {
pid: string;
title: string;
recipientType: "user" | "team";
recipientId: string;
referenceId?: string;
referenceCollection?: string;
createdAt: Date;
};
};
export const dbEvents = new EventEmitter();