2025-03-28 12:45:59 +05:30
|
|
|
import mongoose, { Document, Schema } from "mongoose";
|
|
|
|
|
import MainModel from "../../../connect/mongoose.ts";
|
|
|
|
|
|
|
|
|
|
export interface assetData extends Document {
|
|
|
|
|
modeluuid: string;
|
|
|
|
|
modelfileID: string;
|
|
|
|
|
modelname: string;
|
|
|
|
|
isLocked: boolean;
|
2025-03-29 17:31:08 +05:30
|
|
|
type: string;
|
2025-03-28 12:45:59 +05:30
|
|
|
isVisible: boolean;
|
2025-04-02 09:55:23 +05:30
|
|
|
isArchive:false
|
2025-03-29 17:31:08 +05:30
|
|
|
// position: [];
|
|
|
|
|
// rotation: {
|
|
|
|
|
// x: number;
|
|
|
|
|
// y: number;
|
|
|
|
|
// z: number;
|
|
|
|
|
// };
|
|
|
|
|
points: {
|
|
|
|
|
uuid: string;
|
|
|
|
|
position: [];
|
|
|
|
|
rotation: [];
|
|
|
|
|
actions: [mongoose.Types.ObjectId];
|
|
|
|
|
triggers: [mongoose.Types.ObjectId];
|
|
|
|
|
connections: {
|
|
|
|
|
source: {
|
|
|
|
|
pathUUID: string;
|
|
|
|
|
pointUUID: string;
|
|
|
|
|
};
|
|
|
|
|
targets: [
|
|
|
|
|
{
|
|
|
|
|
pathUUID: string;
|
|
|
|
|
pointUUID: string;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}[];
|
|
|
|
|
}[];
|
2025-04-01 13:27:25 +05:30
|
|
|
position: [];
|
|
|
|
|
// rotation: [];
|
|
|
|
|
rotation: {
|
|
|
|
|
x: number;
|
|
|
|
|
y: number;
|
|
|
|
|
z: number;
|
|
|
|
|
};
|
2025-03-31 18:30:14 +05:30
|
|
|
speed: number | string;
|
2025-03-28 12:45:59 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Define the Mongoose Schema
|
|
|
|
|
const assetDataSchema: Schema = new Schema({
|
2025-04-02 09:55:23 +05:30
|
|
|
isArchive:{type:Boolean,default:false},
|
2025-03-28 12:45:59 +05:30
|
|
|
modeluuid: { type: String },
|
|
|
|
|
modelfileID: { type: String },
|
|
|
|
|
modelname: { type: String },
|
2025-03-29 17:31:08 +05:30
|
|
|
type: { type: String },
|
|
|
|
|
// assetPosition: { type: Array },
|
2025-03-28 12:45:59 +05:30
|
|
|
points: [
|
|
|
|
|
{
|
|
|
|
|
uuid: { type: String },
|
|
|
|
|
position: { type: Array },
|
|
|
|
|
rotation: { type: Array },
|
2025-03-28 17:44:49 +05:30
|
|
|
actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Actions" }],
|
|
|
|
|
triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Triggers" }],
|
2025-03-29 17:31:08 +05:30
|
|
|
connections: {
|
|
|
|
|
source: {
|
|
|
|
|
pathUUID: { type: String },
|
|
|
|
|
pointUUID: { type: String },
|
|
|
|
|
},
|
|
|
|
|
targets: [
|
|
|
|
|
{
|
|
|
|
|
pathUUID: { type: String },
|
|
|
|
|
pointUUID: { type: String },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-03-28 12:45:59 +05:30
|
|
|
},
|
|
|
|
|
],
|
2025-04-01 13:27:25 +05:30
|
|
|
position: { type: Array},
|
|
|
|
|
// rotation: { type: Array},
|
|
|
|
|
rotation: {
|
|
|
|
|
x: { type: Number },
|
|
|
|
|
y: { type: Number },
|
|
|
|
|
z: { type: Number },
|
|
|
|
|
},
|
2025-03-31 18:30:14 +05:30
|
|
|
speed: { type: Schema.Types.Mixed },
|
2025-03-28 12:45:59 +05:30
|
|
|
isLocked: { type: Boolean },
|
|
|
|
|
isVisible: { type: Boolean },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// export default floorItemsModel;
|
|
|
|
|
const assetModel = (db: string) => {
|
|
|
|
|
return MainModel(db, "Assets", assetDataSchema, "Assets");
|
|
|
|
|
};
|
|
|
|
|
export default assetModel;
|