-
Notifications
You must be signed in to change notification settings - Fork 7
Database Structure
0NotApplicable0 edited this page Apr 28, 2021
·
6 revisions
X : Y -> X maps to Y (key/value pair) (NOTE THAT DATABASE STRUCUTURES CHANGED SIGNIFICANTLY SPRING 2021)
[ ] -> array
{
email: {type: String, required: true}, // User email (ID)
first_name: {type: String, required: true},
last_name: {type: String, required: true},
profile_img: {type: String, default: ""},
phone: {type: String, default: ""},
}
{
userId: {type: String, required: true}, // This is the "user"'s id. The mongoDB ID that was created when creating a user
email: {type: String, required: true}, // User email (ID)
first_name: {type: String, required: true},
last_name: {type: String, required: true},
profile_img: {type: String, default: ""},
phone: {type: String, default: ""},
// Time they can tutor
times: {"Sunday": [[Number, Number]], "Monday": [[Number, Number]], "Tuesday": [[Number, Number]], "Wednesday": [[Number, Number]], "Thursday": [[Number, Number]], "Friday": [[Number, Number]], "Saturday": [[Number, Number]]},
price: {type: Number, default: 30},
interval: {type: Number, default: 30},
}
{
token: { type: String, required: true },
uid: { type: mongoose.Schema.Types.ObjectId, ref: 'User' }
}
{
id: {type: String, required: true}, // Subject ID
{
{
id: {type: String, required: true}, // Course ID
subject: {type: String, required: true},
name: {type: String, required: true}, // Course Name
tutors: [Schema.ObjectId] // Array of Tutor IDs (Object IDs)
}
{
appt_id: {type: String, required: true},
course_id: {type: String, required: true},
start_time: {type: Date, required: true},
end_time: {type: Number, required: true},
location: {type: String, required: true},
tutor_id: {type: Schema.ObjectId, required: true}, // Object ID of tutor
client_id: {type: Schema.ObjectId, required: true}, // Object ID of client
price: {type: Number, required: true}, // Total price of session
notes: String,
confirmed: {type: Boolean, default: false} // Accepted by tutor
}