const mongoose = require('mongoose'); const bookingSchema = new mongoose.Schema({ photographerId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, customerId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, date: { type: Date, required: true }, startTime: String, duration: Number, status: { type: String, enum: ['pending', 'confirmed', 'in_progress', 'photos_ready', 'delivered', 'completed', 'cancelled'], default: 'pending' }, totalPrice: Number, sessionNotes: String, packageId: { type: mongoose.Schema.Types.ObjectId, ref: 'Package', default: null }, finalPhotos: [{ type: String }], isDelivered: { type: Boolean, default: false }, timeline: [ { step: { type: String, enum: ['booked', 'confirmed', 'in_progress', 'photos_ready', 'delivered'] }, date: { type: Date, default: Date.now }, note: String } ], createdAt: { type: Date, default: Date.now } }); module.exports = mongoose.model('Booking', bookingSchema);