Skip to content

Commit

Permalink
Revert "fixed naming convention"
Browse files Browse the repository at this point in the history
This reverts commit 8afc9cc.
  • Loading branch information
ArinNigam committed Feb 3, 2024
1 parent 8afc9cc commit 1e9fc47
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 35 deletions.
4 changes: 2 additions & 2 deletions backend/models/course.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion backend/models/faculty.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const facultySchema = new mongoose.Schema({
required: true,
unique: true
},
cabin_number: {
cabinNumber: {
type: String,
},
department: {
Expand Down
4 changes: 0 additions & 4 deletions backend/models/lost_and_found.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import mongoose from 'mongoose';

const lostAndFoundItemSchema = new mongoose.Schema({
userId: {
type: String,
required: true
},
name: {
type: String,
required: true
Expand Down
40 changes: 20 additions & 20 deletions frontend/lib/constants/dummy_entries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,159 +260,159 @@ 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',
courseName: 'Mechanical Engineering Basics',
branches: ['Mechanical Engineering'],
credits: 3,
primaryRoom: 'LT-2',
professor_id: DummyFaculties.faculties[1].id),
professorId: DummyFaculties.faculties[1].id),
Course(
id: '3',
courseCode: 'EE103',
courseName: 'Electrical Engineering Fundamentals',
branches: ['Electrical Engineering'],
credits: 3,
primaryRoom: 'LT-3',
professor_id: DummyFaculties.faculties[2].id),
professorId: DummyFaculties.faculties[2].id),
Course(
id: '4',
courseCode: 'EE104',
courseName: 'Civil Engineering Principles',
branches: ['Civil Engineering'],
credits: 3,
primaryRoom: 'LT-4',
professor_id: DummyFaculties.faculties[3].id),
professorId: DummyFaculties.faculties[3].id),
Course(
id: '5',
courseCode: 'CHE105',
courseName: 'Chemical Engineering Basics',
branches: ['Chemical Engineering'],
credits: 3,
primaryRoom: 'LH-1',
professor_id: DummyFaculties.faculties[4].id),
professorId: DummyFaculties.faculties[4].id),
Course(
id: '6',
courseCode: 'BT106',
courseName: 'Biotechnology Fundamentals',
branches: ['Biotechnology'],
credits: 3,
primaryRoom: 'LH-2',
professor_id: DummyFaculties.faculties[5].id),
professorId: DummyFaculties.faculties[5].id),
Course(
id: '7',
courseCode: 'AE107',
courseName: 'Aerospace Engineering Introduction',
branches: ['Aerospace Engineering'],
credits: 3,
primaryRoom: 'LH-3',
professor_id: DummyFaculties.faculties[6].id),
professorId: DummyFaculties.faculties[6].id),
Course(
id: '8',
courseCode: 'IT108',
courseName: 'Information Technology Essentials',
branches: ['Information Technology'],
credits: 3,
primaryRoom: 'LH-4',
professor_id: DummyFaculties.faculties[7].id),
professorId: DummyFaculties.faculties[7].id),
Course(
id: '9',
courseCode: 'MT109',
courseName: 'Mechatronics Basics',
branches: ['Mechatronics'],
credits: 3,
primaryRoom: 'LH-5',
professor_id: DummyFaculties.faculties[8].id),
professorId: DummyFaculties.faculties[8].id),
Course(
id: '10',
courseCode: 'RE110',
courseName: 'Robotics Engineering Fundamentals',
branches: ['Robotics Engineering'],
credits: 3,
primaryRoom: 'LH-6',
professor_id: DummyFaculties.faculties[9].id),
professorId: DummyFaculties.faculties[9].id),
Course(
id: '11',
courseCode: 'IE111',
courseName: 'Industrial Engineering Principles',
branches: ['Industrial Engineering'],
credits: 3,
primaryRoom: 'LH-7',
professor_id: DummyFaculties.faculties[10].id),
professorId: DummyFaculties.faculties[10].id),
Course(
id: '12',
courseCode: 'CE112',
courseName: 'Computer Engineering Basics',
branches: ['Computer Engineering'],
credits: 3,
primaryRoom: 'LH-8',
professor_id: DummyFaculties.faculties[11].id),
professorId: DummyFaculties.faculties[11].id),
Course(
id: '13',
courseCode: 'SE113',
courseName: 'Software Engineering Fundamentals',
branches: ['Software Engineering'],
credits: 3,
primaryRoom: 'ROOM-101',
professor_id: DummyFaculties.faculties[12].id),
professorId: DummyFaculties.faculties[12].id),
Course(
id: '14',
courseCode: 'EN114',
courseName: 'Environmental Engineering Basics',
branches: ['Environmental Engineering'],
credits: 3,
primaryRoom: 'ROOM-102',
professor_id: DummyFaculties.faculties[13].id),
professorId: DummyFaculties.faculties[13].id),
Course(
id: '15',
courseCode: 'PE115',
courseName: 'Petrolesum[ Engineer]ing Introduction',
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',
courseName: 'Nuclear Engineering Basics',
branches: ['Nuclear Engineering'],
credits: 3,
primaryRoom: 'ROOM-104',
professor_id: DummyFaculties.faculties[15].id),
professorId: DummyFaculties.faculties[15].id),
Course(
id: '17',
courseCode: 'BE117',
courseName: 'Biomedical Engineering Fundamentals',
branches: ['Biomedical Engineering'],
credits: 3,
primaryRoom: 'ROOM-201',
professor_id: DummyFaculties.faculties[16].id),
professorId: DummyFaculties.faculties[16].id),
Course(
id: '18',
courseCode: 'CE118',
courseName: 'Chemical Engineering Principles',
branches: ['Chemical Engineering'],
credits: 3,
primaryRoom: 'ROOM-202',
professor_id: DummyFaculties.faculties[17].id),
professorId: DummyFaculties.faculties[17].id),
Course(
id: '19',
courseCode: 'EE119',
courseName: 'Electronics Engineering Basics',
branches: ['Electronics Engineering'],
credits: 3,
primaryRoom: 'ROOM-203',
professor_id: DummyFaculties.faculties[18].id),
professorId: DummyFaculties.faculties[18].id),
Course(
id: '20',
courseCode: 'CS120',
courseName: 'Advanced Computer Science Topics',
branches: ['Computer Science'],
credits: 3,
primaryRoom: 'ROOM-204',
professor_id: DummyFaculties.faculties[19].id),
professorId: DummyFaculties.faculties[19].id),
];
}

Expand Down
12 changes: 6 additions & 6 deletions frontend/lib/models/course.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Course {
final int credits;
final List<String> branches;
final String primaryRoom;
final String professor_id;
final String professorId;

Course({
required this.id,
Expand All @@ -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<String, dynamic> json) {
Expand All @@ -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'],
);
}

Expand All @@ -37,8 +37,8 @@ class Course {
'name': courseName,
'credits': credits,
'branches': branches,
'primary_room': primaryRoom,
'professor_id': professor_id,
'primaryRoom': primaryRoom,
'professorId': professorId,
};
}
}
4 changes: 2 additions & 2 deletions frontend/lib/models/faculty.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -35,7 +35,7 @@ class Faculty {
'_id': id,
'name': name,
'email': email,
'cabin_number': cabinNumber,
'cabinNumber': cabinNumber,
'department': department,
'courses': courses,
};
Expand Down
4 changes: 4 additions & 0 deletions frontend/lib/models/lost_and_found.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class LostAndFoundItem {
String userId;
String name;
String lastSeenLocation;
String imagePath;
Expand All @@ -7,6 +8,7 @@ class LostAndFoundItem {
bool isLost;

LostAndFoundItem({
required this.userId,
required this.name,
required this.lastSeenLocation,
required this.imagePath,
Expand All @@ -17,6 +19,7 @@ class LostAndFoundItem {

factory LostAndFoundItem.fromJson(Map<String, dynamic> json) {
return LostAndFoundItem(
userId: json['user_id'],
name: json['name'],
lastSeenLocation: json['lastSeenLocation'],
imagePath: json['imagePath'],
Expand All @@ -28,6 +31,7 @@ class LostAndFoundItem {

Map<String, dynamic> toJson() {
return {
'user_id': userId,
'name': name,
'lastSeenLocation': lastSeenLocation,
'imagePath': imagePath,
Expand Down
1 change: 1 addition & 0 deletions frontend/lib/provider/courses_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class CoursesNotifier extends StateNotifier<CoursesState> {
? 0
: int.parse(state.courseCreditController.text),
primaryRoom: '',
professorId: '',
);
state = state.copyWith(
courses: [
Expand Down

0 comments on commit 1e9fc47

Please sign in to comment.