2025-03-18 17:46:24 +05:30
|
|
|
import mongoose, { Document, ObjectId, Schema } from "mongoose";
|
|
|
|
|
import MainModel from "../../connect/mongoose";
|
|
|
|
|
export interface zoneSchema extends Document {
|
|
|
|
|
zoneId: string;
|
|
|
|
|
zoneName: string
|
|
|
|
|
createBy: mongoose.Types.ObjectId
|
|
|
|
|
points: []
|
|
|
|
|
layer: Number
|
2025-03-26 12:23:03 +05:30
|
|
|
viewPortCenter: []
|
|
|
|
|
viewPortposition: []
|
2025-03-18 17:46:24 +05:30
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Define the Mongoose Schema
|
|
|
|
|
const zoneSchema: Schema = new Schema({
|
|
|
|
|
zoneId: { type: String },
|
|
|
|
|
zoneName: { type: String },
|
|
|
|
|
createBy: { type: Schema.Types.ObjectId, ref: "Users", },
|
|
|
|
|
points: { type: Array },
|
|
|
|
|
layer: { type: Number, required: true },
|
2025-03-26 12:23:03 +05:30
|
|
|
viewPortCenter: { type: Array, required: true },
|
|
|
|
|
viewPortposition: { type: Array, required: true },
|
2025-03-18 17:46:24 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// export default zoneModel;
|
|
|
|
|
const zoneModel = (db: string) => {
|
|
|
|
|
return MainModel(db, "zones", zoneSchema, "zones")
|
|
|
|
|
};
|
|
|
|
|
export default zoneModel;
|