feat: Added notifications outbox to admin panel
This commit is contained in:
18
src/schemas/Inbox.ts
Normal file
18
src/schemas/Inbox.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { SimpleMessage } from "@/notif"
|
||||
import mongoose, { Types, Schema } from "mongoose"
|
||||
|
||||
export interface IInbox {
|
||||
message: SimpleMessage,
|
||||
sentDate: Date,
|
||||
rcpt: Types.ObjectId[],
|
||||
ack: Types.ObjectId[]
|
||||
}
|
||||
|
||||
const inboxSchema = new Schema<IInbox>({
|
||||
message: {type: Object, required: true},
|
||||
sentDate: {type: Date, required: true, default: Date.now()},
|
||||
rcpt: [{type: Schema.Types.ObjectId, ref: "logins", required: true}],
|
||||
ack: [{type: Schema.Types.ObjectId, ref: "logins", required: true, default: []}],
|
||||
})
|
||||
|
||||
export default mongoose.model("inbox", inboxSchema)
|
||||
Reference in New Issue
Block a user