2025-06-02 16:48:44 +05:30
|
|
|
import { Schema, Document } from "mongoose";
|
2025-05-17 11:15:53 +05:30
|
|
|
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;
|
2025-06-02 16:48:44 +05:30
|
|
|
zoneId: Zone["_id"];
|
2025-05-17 11:15:53 +05:30
|
|
|
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 },
|
2025-06-02 16:48:44 +05:30
|
|
|
zoneId:{ type: Schema.Types.ObjectId, ref: "Zone" },
|
2025-05-17 11:15:53 +05:30
|
|
|
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;
|