zoneModel updated Structure modified for the API

This commit is contained in:
2025-03-25 12:34:01 +05:30
parent 7a67405d2a
commit 7555eb5c9c
22 changed files with 2074 additions and 118 deletions

View File

@@ -0,0 +1,35 @@
import mongoose, { Schema, Document, model } from "mongoose";
import MainModel from "../../../connect/mongoose.ts";
export interface Zone extends Document {
zoneName: string;
// zoneUUID: string;
zonePoints: [];
centerPoints: [];
isArchive: boolean;
createdBy: string;
sceneID: string;
// createdBy: mongoose.Types.ObjectId;
// sceneID: mongoose.Types.ObjectId;
layer: number;
}
const zoneSchema: Schema = new Schema(
{
zoneName: { type: String },
// zoneUUID: { type: String },
createdBy: { type: String },
sceneID: { type: String },
layer: { type: Number },
centerPoints: { type: Array },
zonePoints: { type: Array },
isArchive: { type: Boolean, default: false },
// createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
// sceneID: { type: mongoose.Schema.Types.ObjectId, ref: "Scene" },
},
{ timestamps: true }
);
const dataModel = (db: any) => {
return MainModel(db, "Zones", zoneSchema, "Zones");
};
export default dataModel;