Files
support-desk/backend/models/noteModel.js
T
2022-12-11 11:28:40 +02:00

33 lines
577 B
JavaScript

const mongoose = require("mongoose");
const noteSchema = mongoose.Schema(
{
user: {
type: mongoose.Schema.Types.ObjectId,
required: true,
ref: "User",
},
ticket: {
type: mongoose.Schema.Types.ObjectId,
required: true,
ref: "Ticket",
},
text: {
type: String,
required: [true, "Please add some text"],
},
isStaff: {
type: Boolean,
default: false,
},
staffId: {
type: String,
},
},
{
timestamps: true,
}
);
module.exports = mongoose.model("Note", noteSchema);