zoneModel updated Structure modified for the API
This commit is contained in:
31
src/shared/model/vizualization/widgemodel.ts
Normal file
31
src/shared/model/vizualization/widgemodel.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface widget extends Document {
|
||||
widgetName: string;
|
||||
widgetType: string;
|
||||
panelorderID: mongoose.Types.ObjectId;
|
||||
isArchive: boolean;
|
||||
// zoneID: string;
|
||||
zoneID: mongoose.Types.ObjectId;
|
||||
sceneID: string;
|
||||
// sceneID: mongoose.Types.ObjectId;
|
||||
Data: string[];
|
||||
}
|
||||
const widgetSchema: Schema = new Schema(
|
||||
{
|
||||
widgetName: { type: String },
|
||||
widgetType: { type: String },
|
||||
Data: { type: Array },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
panelorderID: { type: mongoose.Schema.Types.ObjectId, ref: "Panel" },
|
||||
zoneID: { type: mongoose.Schema.Types.ObjectId, ref: "Zone" },
|
||||
sceneID: { type: String },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const dataModel = (db: any) => {
|
||||
return MainModel(db, "Widget", widgetSchema, "Widget");
|
||||
};
|
||||
export default dataModel;
|
||||
Reference in New Issue
Block a user