We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 730f78e commit 4f72929Copy full SHA for 4f72929
src/models/Vote.js
@@ -0,0 +1,14 @@
1
+/* eslint no-underscore-dangle: ["error", { "allow": ["_id"] }] */
2
+import mongoose, { Schema } from 'mongoose';
3
+
4
+const VoteSchema = new Schema({
5
+ procedure: { type: Schema.Types.ObjectId, ref: 'Procedure', required: true },
6
+ users: [{ type: Schema.Types.ObjectId, ref: 'User', required: true }],
7
+ voteResults: {
8
+ yes: { type: Number, default: 0 },
9
+ no: { type: Number, default: 0 },
10
+ abstination: { type: Number, default: 0 },
11
+ },
12
+});
13
14
+export default mongoose.model('Vote', VoteSchema);
0 commit comments