mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-07 19:10:12 +08:00
feat: update quest and user schema
* add requirements in quest * add progress in user
This commit is contained in:
1 parent
710eb8fc2e
commit
fac91e0f10
6 files changed
+67
-7
No files matched your search
@@ -1,5 +1,24 @@
|
||||
import { model, Schema } from 'mongoose'
|
||||
|
||||
const progressSchema = new Schema({
|
||||
quest: {
|
||||
type: String,
|
||||
ref: 'Quest',
|
||||
},
|
||||
sessions: [
|
||||
{
|
||||
type: Schema.ObjectId,
|
||||
ref: 'Session',
|
||||
},
|
||||
],
|
||||
completionStatus: {
|
||||
type: String,
|
||||
enum: ['incomplete', 'completed'],
|
||||
},
|
||||
startedAt: Date,
|
||||
finishedAt: Date,
|
||||
})
|
||||
|
||||
const User = model(
|
||||
'User',
|
||||
new Schema(
|
||||
@@ -23,6 +42,7 @@ const User = model(
|
||||
id: String,
|
||||
displayName: String,
|
||||
},
|
||||
progress: [progressSchema],
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in new issue
Block a user