api/resources/Notification/notificationModal.js
2024-08-07 15:24:44 +05:30

32 lines
772 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: "KYC",
// 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);