V2 API for visualization gomathi part completed

This commit is contained in:
2025-03-28 17:44:49 +05:30
parent dc5d7c2ebf
commit 2b34040d8c
17 changed files with 658 additions and 160 deletions

View File

@@ -1,6 +1,16 @@
import mongoose, { Document, Schema } from "mongoose";
import MainModel from "../../../connect/mongoose.ts";
interface IAction {
uuid: string;
name: string;
type: string;
material: string;
delay: string;
spawnInterval: string;
isUsed: boolean;
}
// Interface for TypeScript with PascalCase
export interface assetData extends Document {
modeluuid: string;
@@ -42,16 +52,16 @@ const assetDataSchema: Schema = new Schema({
uuid: { type: String },
position: { type: Array },
rotation: { type: Array },
actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Actions" }],
triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Triggers" }],
},
],
isLocked: { type: Boolean },
isVisible: { type: Boolean },
rotation: {
x: { type: Number, required: true },
y: { type: Number, required: true },
z: { type: Number, required: true },
x: { type: Number },
y: { type: Number },
z: { type: Number },
},
});