2025-05-17 10:12:18 +05:30
|
|
|
import { Document, Schema } from "mongoose";
|
2025-03-28 12:45:59 +05:30
|
|
|
import MainModel from "../../../connect/mongoose.ts";
|
|
|
|
|
|
2025-05-10 10:34:24 +05:30
|
|
|
interface ICommonBase {
|
2025-04-30 17:15:45 +05:30
|
|
|
type: string;
|
|
|
|
|
}
|
2025-05-10 10:34:24 +05:30
|
|
|
interface IPointsConveyor extends ICommonBase {
|
2025-04-30 17:15:45 +05:30
|
|
|
points?: {
|
2025-05-10 10:34:24 +05:30
|
|
|
Uuid: string;
|
2025-04-30 17:15:45 +05:30
|
|
|
position: [number, number, number];
|
|
|
|
|
rotation: [number, number, number];
|
|
|
|
|
}[];
|
|
|
|
|
}
|
2025-05-10 10:34:24 +05:30
|
|
|
interface IPoint extends ICommonBase {
|
2025-04-30 17:15:45 +05:30
|
|
|
point?: {
|
2025-05-10 10:34:24 +05:30
|
|
|
Uuid: string;
|
2025-04-30 17:15:45 +05:30
|
|
|
position: [number, number, number];
|
|
|
|
|
rotation: [number, number, number];
|
|
|
|
|
};
|
|
|
|
|
}
|
2025-05-17 10:12:18 +05:30
|
|
|
export interface AssetData extends Document {
|
2025-04-30 17:15:45 +05:30
|
|
|
modelUuid: string;
|
2025-03-28 12:45:59 +05:30
|
|
|
modelfileID: string;
|
2025-04-30 17:15:45 +05:30
|
|
|
modelName: string;
|
2025-03-28 12:45:59 +05:30
|
|
|
isLocked: boolean;
|
2025-03-29 17:31:08 +05:30
|
|
|
type: string;
|
2025-03-28 12:45:59 +05:30
|
|
|
isVisible: boolean;
|
2025-04-03 19:51:51 +05:30
|
|
|
isArchive: false;
|
2025-04-01 13:27:25 +05:30
|
|
|
position: [];
|
2025-04-03 19:51:51 +05:30
|
|
|
rotation: {
|
2025-04-01 13:27:25 +05:30
|
|
|
x: number;
|
|
|
|
|
y: number;
|
|
|
|
|
z: number;
|
|
|
|
|
};
|
2025-03-31 18:30:14 +05:30
|
|
|
speed: number | string;
|
2025-05-10 10:34:24 +05:30
|
|
|
eventData: IPoint | IPointsConveyor;
|
2025-03-28 12:45:59 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const assetDataSchema: Schema = new Schema({
|
2025-04-03 19:51:51 +05:30
|
|
|
isArchive: { type: Boolean, default: false },
|
2025-04-30 17:15:45 +05:30
|
|
|
modelUuid: { type: String },
|
2025-03-28 12:45:59 +05:30
|
|
|
modelfileID: { type: String },
|
2025-04-30 17:15:45 +05:30
|
|
|
modelName: { type: String },
|
2025-03-29 17:31:08 +05:30
|
|
|
type: { type: String },
|
2025-04-03 19:51:51 +05:30
|
|
|
position: { type: Array },
|
2025-04-01 13:27:25 +05:30
|
|
|
rotation: {
|
|
|
|
|
x: { type: Number },
|
|
|
|
|
y: { type: Number },
|
|
|
|
|
z: { type: Number },
|
|
|
|
|
},
|
2025-03-31 18:30:14 +05:30
|
|
|
speed: { type: Schema.Types.Mixed },
|
2025-03-28 12:45:59 +05:30
|
|
|
isLocked: { type: Boolean },
|
|
|
|
|
isVisible: { type: Boolean },
|
2025-04-30 17:15:45 +05:30
|
|
|
eventData: {
|
|
|
|
|
type: Schema.Types.Mixed,
|
|
|
|
|
},
|
2025-03-28 12:45:59 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const assetModel = (db: string) => {
|
|
|
|
|
return MainModel(db, "Assets", assetDataSchema, "Assets");
|
|
|
|
|
};
|
|
|
|
|
export default assetModel;
|