Files
Dwinzo-Backend-V0.0/src/shared/model/simulation/actionmodel.ts

39 lines
940 B
TypeScript

import mongoose, { Schema, Document, model } from "mongoose";
import MainModel from "../../connect/mongoose.ts";
export interface Event extends Document {
pointsUUID: string;
actionUUID: string;
isArchive: string;
sceneID: string;
eventData: {
uuid: string;
type: string;
material: string;
delay: number;
spawn_Interval: number;
};
}
const eventSchema: Schema = new Schema(
{
pointsUUID: { type: String },
isArchive: { type: Boolean, default: false },
actionUUID: { type: String },
eventData: [
{
uuid: { type: String },
type: { type: String },
material: { type: String },
delay: { type: Number },
spawn_Interval: { type: Number },
},
],
},
{ timestamps: true }
);
const actionModel = (db: any) => {
return MainModel(db, "Actions", eventSchema, "Actions");
};
export default actionModel;