Skip to content

Commit 6b09c09

Browse files
committed
conflig development
2 parents 16b40b1 + e148259 commit 6b09c09

File tree

6 files changed

+157
-14
lines changed

6 files changed

+157
-14
lines changed

controller/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function home(req, res) {
2-
res.render("index", { title: "Express" });
2+
res.json({ res: "Server Working" });
33
}
44

55
export default { home };

models/accreditation.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import connector from "#models/databaseUtil";
2+
3+
const accreditationSchema = {
4+
uid: { type: String, unique: true, required: true },
5+
accreditationName: { type: String, required: true },
6+
agencyName: { type: String, required: true },
7+
dateofAccreditation: { type: Date, required: true },
8+
dateofExpiry: { type: Date, required: true },
9+
};
10+
11+
const Accreditation = new connector.model("Accreditation", accreditationSchema);
12+
13+
async function remove(filter) {
14+
const res = await Accreditation.findOneAndDelete(filter);
15+
return res;
16+
}
17+
18+
async function create(uid, accreditationName, agencyName, dateofAccreditation, dateofExpiry) {
19+
const accreditation = new Accreditation({
20+
accreditationName,
21+
agencyName,
22+
uid,
23+
dateofAccreditation,
24+
dateofExpiry,
25+
});
26+
const accreditationDoc = await accreditation.save();
27+
return accreditationDoc;
28+
}
29+
30+
async function read(filter, limit = 1) {
31+
const accreditationData = await Accreditation.find(filter).limit(limit);
32+
return accreditationData;
33+
}
34+
35+
async function update(filter, updateObject) {
36+
const accreditation = await Accreditation.findOneAndUpdate(filter, updateObject, { new: true });
37+
return accreditation;
38+
}
39+
40+
export default {
41+
create, read, update, remove,
42+
};

models/faculty.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
const { connector } = require('./databaseUtil');
2+
3+
const facultySchema = new mongoose.Schema({
4+
name: {
5+
type: String,
6+
required: true,
7+
},
8+
department: {
9+
type: mongoose.Schema.Types.ObjectId,
10+
ref: 'Department',
11+
required: true,
12+
},
13+
empType: {
14+
type: String,
15+
required: true,
16+
},
17+
emdUID: {
18+
type: String,
19+
required: true,
20+
},
21+
preferredSubjects: {
22+
type: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Subject' }],
23+
required: true,
24+
},
25+
profileLink: {
26+
type: String,
27+
required: true,
28+
},
29+
designation: {
30+
type: [String],
31+
required: true,
32+
},
33+
natureOfAssociation: {
34+
type: String,
35+
required: true,
36+
},
37+
uniApprovalStatus: {
38+
type: String,
39+
required: true,
40+
},
41+
qualifications: {
42+
type: [String],
43+
required: true,
44+
},
45+
totalExperience: {
46+
type: String,
47+
required: true,
48+
},
49+
additionalResponsibilities: {
50+
type: String,
51+
required: true,
52+
},
53+
achievements: {
54+
type: [String],
55+
required: true,
56+
},
57+
areaOfSpecialization: {
58+
type: [String],
59+
required: true,
60+
},
61+
papersPublishedPG: {
62+
type: Number,
63+
required: true,
64+
},
65+
papersPublishedUG: {
66+
type: Number,
67+
required: true,
68+
},
69+
email: {
70+
type: String,
71+
required: true,
72+
unique: true,
73+
},
74+
phoneNumber: {
75+
type: String,
76+
required: true,
77+
},
78+
office: {
79+
type: String,
80+
required: true,
81+
},
82+
isTenured: {
83+
type: Boolean,
84+
default: false,
85+
},
86+
joinedDate: {
87+
type: Date,
88+
default: Date.now,
89+
},
90+
});
91+
92+
const Faculty = connector.model('Faculty', facultySchema);
93+
94+
module.exports = Faculty;

models/group.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import connector from "#models/databaseUtil";
2+
3+
const groupSchema = {
4+
groupName: { type: String, required: true },
5+
studentIds: { type: [Number], required: true }, //array of number
6+
}
7+
8+
const groupModel = new connector.model('group', groupSchema);

models/infra.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import connector from "#models/databaseUtil";
2+
3+
const infrastructureSchema = {
4+
infraID: { type: Number, required: true },
5+
infraName: { type: String, required: true },
6+
infraType: { type: String, required: true },
7+
infraWing: { type: String, required: true },
8+
floor: { type: Number, required: true },
9+
capacity: { type: Number, required: true },
10+
};
11+
12+
const infrastructureModel = new connector.model("Infrastructure", infrastructureSchema);

public/index.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)