wallitems update and project model creation

This commit is contained in:
2025-05-13 18:10:11 +05:30
parent 0297ba4993
commit d41142bfd0
7 changed files with 168 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import MainModel from '../../connect/mongoose.ts';
export interface wallitems extends Document {
modelUuid: string;
modelName: string
modelfileID: string;
type: string
csgposition: []
csgscale: []
@@ -16,7 +17,8 @@ export interface wallitems extends Document {
// Define the Mongoose Schema
const wallItemsSchema: Schema = new Schema({
modelUuid: { type: String,unique:true },
modelUuid: { type: String},
modelfileID: { type: String},
modelName: { type: String},
type: { type: String },
csgposition: { type: Array},

View File

@@ -0,0 +1,29 @@
import { Schema, Document, Types } from "mongoose";
import MainModel from "../../connect/mongoose.ts";
import {User} from "../user-Model.ts";
export interface Project extends Document {
projectUuid: string;
projectName: string;
createdBy: User["_id"];
isArchive: boolean
thumbnail: string
sharedUsers: []
}
const projectSchema:Schema = new Schema({
projectUuid: { type: String, required: true },
projectName: { type: String },
thumbnail: { type: String },
isArchive: { type: Boolean,default:false },
createdBy: { type: Schema.Types.ObjectId, ref: "user" },
sharedUsers: [{ type: Schema.Types.ObjectId, ref: "user" }],
}, { timestamps: true })
const projectModel = (db: string) => {
return MainModel(db, "Projects", projectSchema, "Projects");
};
export default projectModel;