Schema Model - new Version Added

This commit is contained in:
2025-05-17 11:15:53 +05:30
parent 5566b74633
commit 1c55013c2b
18 changed files with 833 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { Document, Schema } from "mongoose";
import MainModel from "../../connect/mongoose.ts";
import { User } from "../Auth/userAuthModel.ts";
import { Project } from "../Project/project-model.ts";
import { Version } from "../Version/versionModel.ts";
export interface WallItems extends Document {
userId: User["_id"];
projectId: Project["_id"];
versionId: Version["_id"];
modelUuid: string;
modelName: string;
type: string;
csgposition: [];
csgscale: [];
position: [];
quaternion: [];
scale: [];
}
const wallItemsSchema: Schema = new Schema({
userId: { type: Schema.Types.ObjectId, ref: "User" },
projectId: { type: Schema.Types.ObjectId, ref: "Project" },
versionId: { type: Schema.Types.ObjectId, ref: "Version" },
modelUuid: { type: String, unique: true },
modelName: { type: String },
type: { type: String },
csgposition: { type: Array },
csgscale: { type: Array },
position: { type: Array },
quaternion: { type: Array },
scale: { type: Array },
});
const wallItemModel = (db: string) => {
return MainModel(db, "wallitems", wallItemsSchema, "wallitems");
};
export default wallItemModel;