Spaces:
Sleeping
Sleeping
| const mongoose = require('mongoose'); | |
| const photographerSchema = new mongoose.Schema({ | |
| userId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, | |
| portfolio: [ | |
| { | |
| url: String, | |
| caption: String, | |
| category: String | |
| } | |
| ], | |
| pricePerHour: Number, | |
| currency: { type: String, default: 'USD' }, | |
| availability: [ | |
| { | |
| day: String, | |
| startTime: String, | |
| endTime: String | |
| } | |
| ], | |
| rating: { type: Number, default: 0 }, | |
| reviewsCount: { type: Number, default: 0 } | |
| }); | |
| module.exports = mongoose.model('Photographer', photographerSchema); | |