Squashed 'backend/' content from commit fa83223
git-subtree-dir: backend git-subtree-split: fa832234607d359848516c9334f2eec45f64969e
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import mongoose, { Schema } from "mongoose";
|
||||
|
||||
interface IVote {
|
||||
timestamp: Date;
|
||||
user: mongoose.Types.ObjectId;
|
||||
dom: Date;
|
||||
tom: "sn" | "ob" | "kol" | "soup" | "cd" | "dr" | "other";
|
||||
name: string;
|
||||
vote: {
|
||||
"rating": number;
|
||||
"comment": string;
|
||||
"tags": string[];
|
||||
}
|
||||
}
|
||||
|
||||
const voteSchema = new Schema<IVote>({
|
||||
timestamp: {type: Date, required: true},
|
||||
user: {type: mongoose.Schema.Types.ObjectId, required: true},
|
||||
dom: {type: Date, required: true},
|
||||
tom: {type: String, required: true},
|
||||
vote: {type: Object, required: true},
|
||||
name: {type: String, required: true}
|
||||
})
|
||||
|
||||
export default mongoose.model("vote", voteSchema)
|
||||
Reference in New Issue
Block a user