const mongoose = require('mongoose');

const timelineSchema = new mongoose.Schema({
    referenceId: {
        type: mongoose.Schema.Types.ObjectId,
        required: true,
        index: true
    },
    referenceModel: {
        type: String,
        required: true,
        enum: ['Booking'], // Expand as needed
        default: 'Booking'
    },
    title: {
        type: String,
        required: true
    },
    status: {
        type: String,
        required: true
    },
    description: {
        type: String
    },
    timestamp: {
        type: Date,
        default: Date.now
    }
}, { timestamps: true });

module.exports = mongoose.model('Timeline', timelineSchema);
