Added backend and integration for FilterPage and CourseTable done
This commit is contained in:
11
server/models/Appointment.js
Normal file
11
server/models/Appointment.js
Normal file
@@ -0,0 +1,11 @@
|
||||
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);
|
||||
13
server/models/Course.js
Normal file
13
server/models/Course.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const CourseSchema = new mongoose.Schema({
|
||||
courseId: { type: String, required: true, unique: true },
|
||||
name: { type: String, required: true },
|
||||
department: { type: String, required: true },
|
||||
program: { type: String, required: true },
|
||||
scheme: { type: String, required: true },
|
||||
semester: { type: Number, required: true },
|
||||
status: { type: String, enum: ["submitted", "not submitted"], default: "not submitted" },
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Course", CourseSchema);
|
||||
11
server/models/Faculty.js
Normal file
11
server/models/Faculty.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const FacultySchema = new mongoose.Schema({
|
||||
facultyId: { type: String, required: true, unique: true },
|
||||
name: { type: String, required: true },
|
||||
email: { type: String, required: true },
|
||||
department: { type: String, required: true },
|
||||
program: { type: String, required: true },
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Faculty", FacultySchema);
|
||||
Reference in New Issue
Block a user