refactor
This commit is contained in:
1 parent
c1bb1fd29d
commit
c42932a7b3
15 files changed
+217
-76
No files matched your search
@@ -9,10 +9,7 @@ export type { IMonitorStats } from "./monitors/MonitorStats.js";
|
||||
export { User } from "./auth/User.js";
|
||||
export type { IUser, IUserProfile } from "./auth/User.js";
|
||||
|
||||
export {
|
||||
NotificationChannel,
|
||||
ChannelTypes,
|
||||
} from "./notification-channel/NotificationChannel.js";
|
||||
export { NotificationChannel } from "./notification-channel/NotificationChannel.js";
|
||||
export type { INotificationChannel } from "./notification-channel/NotificationChannel.js";
|
||||
|
||||
export { Invite } from "./auth/Invite.js";
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
import mongoose, { Schema, Types } from "mongoose";
|
||||
export const ChannelTypes = ["email", "slack", "discord", "webhook"] as const;
|
||||
export type ChannelType = (typeof ChannelTypes)[number];
|
||||
|
||||
export interface INotificationChannelConfig {
|
||||
url?: string; // For webhook, slack, discord
|
||||
emailAddress?: string; // For email
|
||||
}
|
||||
|
||||
import {
|
||||
type ChannelType,
|
||||
ChannelTypes,
|
||||
NotificationChannelConfig,
|
||||
} from "@/types/domain/index.js";
|
||||
export interface INotificationChannel {
|
||||
_id: Types.ObjectId;
|
||||
orgId: Types.ObjectId;
|
||||
teamId: Types.ObjectId;
|
||||
name: string;
|
||||
type: ChannelType;
|
||||
config: INotificationChannelConfig;
|
||||
config: NotificationChannelConfig;
|
||||
isActive: boolean;
|
||||
createdBy: Types.ObjectId;
|
||||
updatedBy: Types.ObjectId;
|
||||
@@ -21,7 +18,7 @@ export interface INotificationChannel {
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
const NotificationChannelConfigSchema = new Schema<INotificationChannelConfig>(
|
||||
const NotificationChannelConfigSchema = new Schema<NotificationChannelConfig>(
|
||||
{
|
||||
url: { type: String, required: false },
|
||||
emailAddress: { type: String, required: false },
|
||||
|
||||
Reference in new issue
Block a user