Schema Model - new Version Added
This commit is contained in:
37
src/shared/V1Models/Vizualization/3dwidget.ts
Normal file
37
src/shared/V1Models/Vizualization/3dwidget.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
import { Zone } from "../Builder/zoneModel.ts";
|
||||
export interface Widget3d extends Document {
|
||||
type: string;
|
||||
widgetID: string;
|
||||
widgetName: string;
|
||||
position: [];
|
||||
rotation: [];
|
||||
isArchive: boolean;
|
||||
zoneId: Zone["_id"];
|
||||
Data: {
|
||||
measurements: {};
|
||||
duration: string;
|
||||
};
|
||||
}
|
||||
const Widget3dSchema: Schema = new Schema(
|
||||
{
|
||||
type: { type: String },
|
||||
widgetID: { type: String },
|
||||
widgetName: { type: String, default: "Widget3D" },
|
||||
position: { type: Array },
|
||||
rotation: { type: Array },
|
||||
zoneId: { type: Schema.Types.ObjectId, ref: "Zone" },
|
||||
Data: {
|
||||
measurements: { type: Object, default: {} },
|
||||
duration: { type: String, default: "1h" },
|
||||
},
|
||||
isArchive: { type: Boolean, default: false },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const widget3dModel = (db: any) => {
|
||||
return MainModel(db, "3dWidget", Widget3dSchema, "3dWidget");
|
||||
};
|
||||
export default widget3dModel;
|
||||
Reference in New Issue
Block a user