2025-03-07 17:55:44 +01:00
|
|
|
import { Schema, Document } from 'mongoose';
|
2024-09-11 06:34:25 -07:00
|
|
|
|
2025-03-07 17:55:44 +01:00
|
|
|
export interface IBanner extends Document {
|
|
|
|
|
bannerId: string;
|
|
|
|
|
message: string;
|
|
|
|
|
displayFrom: Date;
|
|
|
|
|
displayTo?: Date;
|
|
|
|
|
type: 'banner' | 'popup';
|
|
|
|
|
isPublic: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bannerSchema = new Schema<IBanner>(
|
2024-09-11 06:34:25 -07:00
|
|
|
{
|
|
|
|
|
bannerId: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
type: String,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
displayFrom: {
|
|
|
|
|
type: Date,
|
|
|
|
|
required: true,
|
|
|
|
|
default: Date.now,
|
|
|
|
|
},
|
|
|
|
|
displayTo: {
|
|
|
|
|
type: Date,
|
|
|
|
|
},
|
|
|
|
|
type: {
|
|
|
|
|
type: String,
|
|
|
|
|
enum: ['banner', 'popup'],
|
|
|
|
|
default: 'banner',
|
|
|
|
|
},
|
|
|
|
|
isPublic: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{ timestamps: true },
|
|
|
|
|
);
|
|
|
|
|
|
2025-03-07 17:55:44 +01:00
|
|
|
export default bannerSchema;
|