feat: add exceptions to stage

This commit is contained in:
Lin, Hung-Shin committed 2023-11-21 14:27:43 +08:00
1 parent 56d96cf7a0
commit 66ce015f0e
6 files changed
+86 -1

No files matched your search

+24
View File
@@ -35,6 +35,26 @@ conditionSchema.add({
not: conditionSchema,
})
const exceptionSchema = new Schema({
condition: {
type: conditionSchema,
required: false,
},
catchAll: {
type: Boolean,
required: true,
default: false,
},
responses: {
type: [responseSchema],
required: true,
},
hints: {
type: [String],
required: true,
},
})
const stageSchema = new Schema({
id: {
type: String,
@@ -66,6 +86,10 @@ const stageSchema = new Schema({
type: [String],
required: true,
},
exceptions: {
type: [exceptionSchema],
required: true,
},
})
const Quest = model(