const mongoose = require('mongoose');

const logActivitySchema = new mongoose.Schema({
  orderId: {
     type: mongoose.Schema.Types.ObjectId,
         ref: 'CafeOrder', // Reference to the Branch model
         required: true,
  },
  userId: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User', // Reference to the User model{
    required: true,
  },
  paidAmount: { type:Number, required: true},

  waiterName: { type:String, required: false, default:''},

  action: {
    type: String,
    required: true,
  },
  timestamp: {
    type: Date,
    default: Date.now, // Automatically log the time of the activity
  },
});

module.exports = mongoose.model('LogActivity', logActivitySchema);
