const mongoose = require("mongoose"); const { v4: uuidv4 } = require("uuid"); // For UUID generation const AppointmentSchema = new mongoose.Schema({ appointmentId: { type: String, default: uuidv4 }, // Auto-generate using UUID courseId: { type: String, required: true, ref: "Course" }, facultyId: { type: String, required: true, ref: "Faculty" }, appointmentType: { type: [String], required: true }, // Array of appointment types }); module.exports = mongoose.model("Appointment", AppointmentSchema);