Spaces:
Sleeping
Sleeping
File size: 583 Bytes
0f8617c | 1 2 3 4 5 6 7 8 9 10 11 12 13 | const mongoose = require('mongoose');
const reviewSchema = new mongoose.Schema({
photographerId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
customerId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
bookingId: { type: mongoose.Schema.Types.ObjectId, ref: 'Booking', required: true, unique: true },
rating: { type: Number, required: true, min: 1, max: 5 },
comment: { type: String, required: true },
createdAt: { type: Date, default: Date.now }
});
module.exports = mongoose.model('Review', reviewSchema);
|