38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
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;
|