diff --git a/backend/models/course.js b/backend/models/course.js index 2093559..d29d67f 100644 --- a/backend/models/course.js +++ b/backend/models/course.js @@ -10,14 +10,14 @@ const courseSchema = new mongoose.Schema({ required: true, unique: true }, - primary_room: { + primaryRoom: { type: String, }, credits: { type: Number, required: true, }, - professor_id: { + professorId: { type: mongoose.Schema.Types.ObjectId, ref: 'Faculty', required: true, diff --git a/backend/models/faculty.js b/backend/models/faculty.js index 1f5e55e..c61c912 100644 --- a/backend/models/faculty.js +++ b/backend/models/faculty.js @@ -10,7 +10,7 @@ const facultySchema = new mongoose.Schema({ required: true, unique: true }, - cabin_number: { + cabinNumber: { type: String, }, department: { diff --git a/backend/models/lost_and_found.js b/backend/models/lost_and_found.js index 6d9c29d..2ff415d 100644 --- a/backend/models/lost_and_found.js +++ b/backend/models/lost_and_found.js @@ -1,10 +1,6 @@ import mongoose from 'mongoose'; const lostAndFoundItemSchema = new mongoose.Schema({ - userId: { - type: String, - required: true - }, name: { type: String, required: true diff --git a/frontend/lib/constants/dummy_entries.dart b/frontend/lib/constants/dummy_entries.dart index 6fa8c12..32f06d8 100644 --- a/frontend/lib/constants/dummy_entries.dart +++ b/frontend/lib/constants/dummy_entries.dart @@ -260,7 +260,7 @@ class DummyCourses { branches: ['Computer Science'], credits: 3, primaryRoom: 'LT-1', - professor_id: DummyFaculties.faculties[0].id), + professorId: DummyFaculties.faculties[0].id), Course( id: '2', courseCode: 'ME102', @@ -268,7 +268,7 @@ class DummyCourses { branches: ['Mechanical Engineering'], credits: 3, primaryRoom: 'LT-2', - professor_id: DummyFaculties.faculties[1].id), + professorId: DummyFaculties.faculties[1].id), Course( id: '3', courseCode: 'EE103', @@ -276,7 +276,7 @@ class DummyCourses { branches: ['Electrical Engineering'], credits: 3, primaryRoom: 'LT-3', - professor_id: DummyFaculties.faculties[2].id), + professorId: DummyFaculties.faculties[2].id), Course( id: '4', courseCode: 'EE104', @@ -284,7 +284,7 @@ class DummyCourses { branches: ['Civil Engineering'], credits: 3, primaryRoom: 'LT-4', - professor_id: DummyFaculties.faculties[3].id), + professorId: DummyFaculties.faculties[3].id), Course( id: '5', courseCode: 'CHE105', @@ -292,7 +292,7 @@ class DummyCourses { branches: ['Chemical Engineering'], credits: 3, primaryRoom: 'LH-1', - professor_id: DummyFaculties.faculties[4].id), + professorId: DummyFaculties.faculties[4].id), Course( id: '6', courseCode: 'BT106', @@ -300,7 +300,7 @@ class DummyCourses { branches: ['Biotechnology'], credits: 3, primaryRoom: 'LH-2', - professor_id: DummyFaculties.faculties[5].id), + professorId: DummyFaculties.faculties[5].id), Course( id: '7', courseCode: 'AE107', @@ -308,7 +308,7 @@ class DummyCourses { branches: ['Aerospace Engineering'], credits: 3, primaryRoom: 'LH-3', - professor_id: DummyFaculties.faculties[6].id), + professorId: DummyFaculties.faculties[6].id), Course( id: '8', courseCode: 'IT108', @@ -316,7 +316,7 @@ class DummyCourses { branches: ['Information Technology'], credits: 3, primaryRoom: 'LH-4', - professor_id: DummyFaculties.faculties[7].id), + professorId: DummyFaculties.faculties[7].id), Course( id: '9', courseCode: 'MT109', @@ -324,7 +324,7 @@ class DummyCourses { branches: ['Mechatronics'], credits: 3, primaryRoom: 'LH-5', - professor_id: DummyFaculties.faculties[8].id), + professorId: DummyFaculties.faculties[8].id), Course( id: '10', courseCode: 'RE110', @@ -332,7 +332,7 @@ class DummyCourses { branches: ['Robotics Engineering'], credits: 3, primaryRoom: 'LH-6', - professor_id: DummyFaculties.faculties[9].id), + professorId: DummyFaculties.faculties[9].id), Course( id: '11', courseCode: 'IE111', @@ -340,7 +340,7 @@ class DummyCourses { branches: ['Industrial Engineering'], credits: 3, primaryRoom: 'LH-7', - professor_id: DummyFaculties.faculties[10].id), + professorId: DummyFaculties.faculties[10].id), Course( id: '12', courseCode: 'CE112', @@ -348,7 +348,7 @@ class DummyCourses { branches: ['Computer Engineering'], credits: 3, primaryRoom: 'LH-8', - professor_id: DummyFaculties.faculties[11].id), + professorId: DummyFaculties.faculties[11].id), Course( id: '13', courseCode: 'SE113', @@ -356,7 +356,7 @@ class DummyCourses { branches: ['Software Engineering'], credits: 3, primaryRoom: 'ROOM-101', - professor_id: DummyFaculties.faculties[12].id), + professorId: DummyFaculties.faculties[12].id), Course( id: '14', courseCode: 'EN114', @@ -364,7 +364,7 @@ class DummyCourses { branches: ['Environmental Engineering'], credits: 3, primaryRoom: 'ROOM-102', - professor_id: DummyFaculties.faculties[13].id), + professorId: DummyFaculties.faculties[13].id), Course( id: '15', courseCode: 'PE115', @@ -372,7 +372,7 @@ class DummyCourses { branches: ['Petrolesum[ Engineer]ing'], credits: 3, primaryRoom: 'ROOM-103', - professor_id: DummyFaculties.faculties[14].id), + professorId: DummyFaculties.faculties[14].id), Course( id: '16', courseCode: 'NE116', @@ -380,7 +380,7 @@ class DummyCourses { branches: ['Nuclear Engineering'], credits: 3, primaryRoom: 'ROOM-104', - professor_id: DummyFaculties.faculties[15].id), + professorId: DummyFaculties.faculties[15].id), Course( id: '17', courseCode: 'BE117', @@ -388,7 +388,7 @@ class DummyCourses { branches: ['Biomedical Engineering'], credits: 3, primaryRoom: 'ROOM-201', - professor_id: DummyFaculties.faculties[16].id), + professorId: DummyFaculties.faculties[16].id), Course( id: '18', courseCode: 'CE118', @@ -396,7 +396,7 @@ class DummyCourses { branches: ['Chemical Engineering'], credits: 3, primaryRoom: 'ROOM-202', - professor_id: DummyFaculties.faculties[17].id), + professorId: DummyFaculties.faculties[17].id), Course( id: '19', courseCode: 'EE119', @@ -404,7 +404,7 @@ class DummyCourses { branches: ['Electronics Engineering'], credits: 3, primaryRoom: 'ROOM-203', - professor_id: DummyFaculties.faculties[18].id), + professorId: DummyFaculties.faculties[18].id), Course( id: '20', courseCode: 'CS120', @@ -412,7 +412,7 @@ class DummyCourses { branches: ['Computer Science'], credits: 3, primaryRoom: 'ROOM-204', - professor_id: DummyFaculties.faculties[19].id), + professorId: DummyFaculties.faculties[19].id), ]; } diff --git a/frontend/lib/models/course.dart b/frontend/lib/models/course.dart index d3e8e1e..bb393b6 100644 --- a/frontend/lib/models/course.dart +++ b/frontend/lib/models/course.dart @@ -5,7 +5,7 @@ class Course { final int credits; final List branches; final String primaryRoom; - final String professor_id; + final String professorId; Course({ required this.id, @@ -14,7 +14,7 @@ class Course { required this.credits, required this.branches, required this.primaryRoom, - required this.professor_id, + required this.professorId, }); factory Course.fromJson(Map json) { @@ -25,8 +25,8 @@ class Course { credits: json['credits'], branches: (json['branches'] as List).map((item) => item as String).toList(), - primaryRoom: json['primary_room'], - professor_id: json['professor_id'], + primaryRoom: json['primaryRoom'], + professorId: json['professorId'], ); } @@ -37,8 +37,8 @@ class Course { 'name': courseName, 'credits': credits, 'branches': branches, - 'primary_room': primaryRoom, - 'professor_id': professor_id, + 'primaryRoom': primaryRoom, + 'professorId': professorId, }; } } diff --git a/frontend/lib/models/faculty.dart b/frontend/lib/models/faculty.dart index f2b2804..4acb376 100644 --- a/frontend/lib/models/faculty.dart +++ b/frontend/lib/models/faculty.dart @@ -22,7 +22,7 @@ class Faculty { id: json['_id'], name: json['name'] ?? 'Smart Insti User', email: json['email'], - cabinNumber: json['cabin_number'], + cabinNumber: json['cabinNumber'], department: json['department'], courses: (json['courses'] as List) .map((item) => Course.fromJson(item)) @@ -35,7 +35,7 @@ class Faculty { '_id': id, 'name': name, 'email': email, - 'cabin_number': cabinNumber, + 'cabinNumber': cabinNumber, 'department': department, 'courses': courses, }; diff --git a/frontend/lib/models/lost_and_found.dart b/frontend/lib/models/lost_and_found.dart index d7058b1..64a01ad 100644 --- a/frontend/lib/models/lost_and_found.dart +++ b/frontend/lib/models/lost_and_found.dart @@ -1,4 +1,5 @@ class LostAndFoundItem { + String userId; String name; String lastSeenLocation; String imagePath; @@ -7,6 +8,7 @@ class LostAndFoundItem { bool isLost; LostAndFoundItem({ + required this.userId, required this.name, required this.lastSeenLocation, required this.imagePath, @@ -17,6 +19,7 @@ class LostAndFoundItem { factory LostAndFoundItem.fromJson(Map json) { return LostAndFoundItem( + userId: json['user_id'], name: json['name'], lastSeenLocation: json['lastSeenLocation'], imagePath: json['imagePath'], @@ -28,6 +31,7 @@ class LostAndFoundItem { Map toJson() { return { + 'user_id': userId, 'name': name, 'lastSeenLocation': lastSeenLocation, 'imagePath': imagePath, diff --git a/frontend/lib/provider/courses_provider.dart b/frontend/lib/provider/courses_provider.dart index 3c81f08..737026c 100644 --- a/frontend/lib/provider/courses_provider.dart +++ b/frontend/lib/provider/courses_provider.dart @@ -126,6 +126,7 @@ class CoursesNotifier extends StateNotifier { ? 0 : int.parse(state.courseCreditController.text), primaryRoom: '', + professorId: '', ); state = state.copyWith( courses: [