32 lines
756 B
JavaScript
32 lines
756 B
JavaScript
import mongoose, { model, Schema } from "mongoose";
|
|
|
|
const notificationSchema = new Schema(
|
|
{
|
|
title: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
msg: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
Kyc_ref: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: "KYC",
|
|
},
|
|
added_for: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
refPath: "userType",
|
|
required: true, // Assuming this should be required
|
|
},
|
|
userType: {
|
|
type: String,
|
|
required: true, // Assuming this should be required
|
|
enum: ["SalesCoOrdinator", "TerritoryManager"],
|
|
},
|
|
},
|
|
{ timestamps: true } // Adds createdAt and updatedAt timestamps
|
|
);
|
|
|
|
export const Notification = model("Notification", notificationSchema);
|