mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +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
@@ -54,7 +54,10 @@ const stageSchema = new Schema({
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
condition: conditionSchema,
|
||||
condition: {
|
||||
type: conditionSchema,
|
||||
required: true,
|
||||
},
|
||||
responses: {
|
||||
type: [responseSchema],
|
||||
required: true,
|
||||
@@ -68,11 +71,32 @@ const stageSchema = new Schema({
|
||||
const Quest = model(
|
||||
'Quest',
|
||||
new Schema({
|
||||
_id: String,
|
||||
title: String,
|
||||
order: Number,
|
||||
instruction: String,
|
||||
stages: [stageSchema],
|
||||
_id: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
requirements: {
|
||||
type: [
|
||||
{
|
||||
type: String,
|
||||
ref: 'Quest',
|
||||
},
|
||||
],
|
||||
required: true,
|
||||
},
|
||||
instruction: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
stages: {
|
||||
type: [stageSchema],
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user