2025-03-28 12:45:59 +05:30
|
|
|
import mongoose, { Document, Schema } from "mongoose";
|
|
|
|
|
import MainModel from "../../../connect/mongoose.ts";
|
|
|
|
|
|
2025-03-28 17:44:49 +05:30
|
|
|
interface IAction {
|
|
|
|
|
uuid: string;
|
|
|
|
|
name: string;
|
|
|
|
|
type: string;
|
|
|
|
|
material: string;
|
|
|
|
|
delay: string;
|
|
|
|
|
spawnInterval: string;
|
|
|
|
|
isUsed: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-28 12:45:59 +05:30
|
|
|
// Interface for TypeScript with PascalCase
|
|
|
|
|
export interface assetData extends Document {
|
|
|
|
|
modeluuid: string;
|
|
|
|
|
modelfileID: string;
|
|
|
|
|
modelname: string;
|
|
|
|
|
isLocked: boolean;
|
|
|
|
|
isVisible: boolean;
|
|
|
|
|
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
|
|
|
|
|
// },
|
|
|
|
|
// target:[]
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Define the Mongoose Schema
|
|
|
|
|
const assetDataSchema: Schema = new Schema({
|
|
|
|
|
modeluuid: { type: String },
|
|
|
|
|
modelfileID: { type: String },
|
|
|
|
|
modelname: { type: String },
|
|
|
|
|
position: { type: Array },
|
|
|
|
|
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-28 12:45:59 +05:30
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
isLocked: { type: Boolean },
|
|
|
|
|
isVisible: { type: Boolean },
|
|
|
|
|
rotation: {
|
2025-03-28 17:44:49 +05:30
|
|
|
x: { type: Number },
|
|
|
|
|
y: { type: Number },
|
|
|
|
|
z: { type: Number },
|
2025-03-28 12:45:59 +05:30
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// export default floorItemsModel;
|
|
|
|
|
const assetModel = (db: string) => {
|
|
|
|
|
return MainModel(db, "Assets", assetDataSchema, "Assets");
|
|
|
|
|
};
|
|
|
|
|
export default assetModel;
|