Spaces:
Running
Running
| const mongoose = require('mongoose'); | |
| const bannerSchema = mongoose.Schema( | |
| { | |
| imageUrl: { type: String, required: true }, | |
| title: { type: String, default: '' }, | |
| subtitle: { type: String, default: '' }, | |
| linkType: { type: String, enum: ['none', 'category', 'product', 'url'], default: 'none' }, | |
| linkValue: { type: String, default: '' }, | |
| order: { type: Number, default: 0 }, | |
| isActive: { type: Boolean, default: true }, | |
| expiresAt: { type: Date, default: null } | |
| }, | |
| { | |
| timestamps: true, | |
| } | |
| ); | |
| const Banner = mongoose.model('Banner', bannerSchema); | |
| module.exports = Banner; | |