diff --git a/users/userservice/database/history-model.js b/users/userservice/database/history-model.js new file mode 100644 index 00000000..3b26c015 --- /dev/null +++ b/users/userservice/database/history-model.js @@ -0,0 +1,28 @@ +const mongoose = require('mongoose'); + +const historySchema = new mongoose.Schema({ + total_correct_answers: { + type: Number, + required: true, + }, + total_failed_answers: { + type: Number, + required: true, + }, + total_punctuation: { + type: Number, + required: true, + }, + total_time: { + type: TimeStamp, + required: true, + }, + user: { + type: User, + required: true, + }, +}); + +const History = mongoose.model('History', historySchema, 'History'); + +module.exports = History \ No newline at end of file