API creation for Product EventDatas and updating asset files

This commit is contained in:
2025-04-30 17:15:45 +05:30
parent 4c4e37e602
commit e9eda96875
19 changed files with 1281 additions and 305 deletions

View File

@@ -1,15 +1,32 @@
import mongoose, { Document, Schema } from "mongoose";
import MainModel from "../../../connect/mongoose.ts";
interface ICommonBase{
type: string;
}
interface IPointsConveyor extends ICommonBase{
points?: {
Uuid:string;
position: [number, number, number];
rotation: [number, number, number];
}[];
}
interface IPoint extends ICommonBase{
point?: {
Uuid:string;
position: [number, number, number];
rotation: [number, number, number];
};
}
export interface assetData extends Document {
modeluuid: string;
modelUuid: string;
modelfileID: string;
modelname: string;
modelName: string;
isLocked: boolean;
type: string;
isVisible: boolean;
isArchive: false;
points: [] | {};
// points: [] | {};
position: [];
rotation: {
x: number;
@@ -17,15 +34,17 @@ export interface assetData extends Document {
z: number;
};
speed: number | string;
eventData: IPoint|IPointsConveyor
}
const assetDataSchema: Schema = new Schema({
isArchive: { type: Boolean, default: false },
modeluuid: { type: String },
modelUuid: { type: String },
modelfileID: { type: String },
modelname: { type: String },
modelName: { type: String },
type: { type: String },
points: { type: Schema.Types.Mixed },
// points: { type: Schema.Types.Mixed },
position: { type: Array },
rotation: {
x: { type: Number },
@@ -35,6 +54,10 @@ const assetDataSchema: Schema = new Schema({
speed: { type: Schema.Types.Mixed },
isLocked: { type: Boolean },
isVisible: { type: Boolean },
eventData: {
type: Schema.Types.Mixed,
required: true,
},
});
// export default floorItemsModel;
@@ -47,9 +70,9 @@ export default assetModel;
// import MainModel from "../../../connect/mongoose.ts";
// export interface assetData extends Document {
// modeluuid: string;
// modelUuid: string;
// modelfileID: string;
// modelname: string;
// modelName: string;
// isLocked: boolean;
// type: string;
// isVisible: boolean;
@@ -92,9 +115,9 @@ export default assetModel;
// // Define the Mongoose Schema
// const assetDataSchema: Schema = new Schema({
// isArchive: { type: Boolean, default: false },
// modeluuid: { type: String },
// modelUuid: { type: String },
// modelfileID: { type: String },
// modelname: { type: String },
// modelName: { type: String },
// type: { type: String },
// // assetPosition: { type: Array },
// points: [