const mongoose = require('mongoose');

const bannerSchema = new mongoose.Schema({
  image: {
    type: String,
    required: true
  }
}, {
  timestamps: true
});

// Static method to get all banners (no filtering needed)
bannerSchema.statics.getAllBanners = function() {
  return this.find().sort({ createdAt: -1 });
};

module.exports = mongoose.model('Banner', bannerSchema);