import { Schema, Document, model } from "mongoose"; import MainModel from "../../connect/mongoose.ts"; import { Zone } from "../Builder/zoneModel.ts"; export interface FloatingWidget extends Document { className: string; iconName: string; header: string; floatWidgetID: string; position: {}; per: string; value: string; isArchive: boolean; zoneId: string; Data: { measurements: {}; duration: string; }; } const floatingWidgetSchema: Schema = new Schema( { className: { type: String }, iconName: { type: String }, header: { type: String }, floatWidgetID: { type: String }, position: { type: Object }, per: { type: String }, value: { type: String }, zoneId: { type: String }, Data: { measurements: { type: Object, default: {} }, duration: { type: String, default: "1h" }, }, isArchive: { type: Boolean, default: false }, }, { timestamps: true } ); const floatWidgetModel = (db: any) => { return MainModel( db, "FloatingWidget", floatingWidgetSchema, "FloatingWidget" ); }; export default floatWidgetModel;