Vulcan/packages/vulcan-voting/lib/modules/votes/schema.js
2018-01-03 08:56:39 +09:00

61 lines
No EOL
914 B
JavaScript

const schema = {
_id: {
type: String,
viewableBy: ['guests'],
},
/**
The id of the document that was voted on
*/
documentId: {
type: String,
viewableBy: ['guests'],
},
/**
The name of the collection the document belongs to
*/
collectionName: {
type: String,
viewableBy: ['guests'],
},
/**
The id of the user that voted
*/
userId: {
type: String,
viewableBy: ['guests'],
},
/**
An optional vote type (for Facebook-style reactions)
*/
voteType: {
type: String,
optional: true,
viewableBy: ['guests'],
},
/**
The vote power (e.g. 1 = upvote, -1 = downvote, or any other value)
*/
power: {
type: Number,
optional: true,
viewableBy: ['guests'],
},
/**
The vote timestamp
*/
votedAt: {
type: Date,
optional: true,
viewableBy: ['guests'],
}
};
export default schema;