Spaces:
Running
Running
File size: 565 Bytes
8a6248c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import mongoose from 'mongoose'
const appointmentSchema = new mongoose.Schema({
farmerId: {
type: mongoose.Schema.Types.ObjectId, ref: 'User',required: true
},
expertId:{
type: mongoose.Schema.Types.ObjectId, ref: 'User',required: true
},
status:{
type: String,
enum:[
'pending', 'accepted', 'declined'
],
default: 'pending'
},
date:{
type: Date,
default: Date.now
}
}, {timestamps: true});
export default mongoose.model('Appointment', appointmentSchema); |