diff --git a/models/Recipe.model.js b/models/Recipe.model.js index 7b2ad14..d86c93b 100644 --- a/models/Recipe.model.js +++ b/models/Recipe.model.js @@ -3,6 +3,53 @@ const Schema = mongoose.Schema; const recipeSchema = new Schema({ // TODO: write the schema + title: { + type: String, + required: true, + unique: true + }, + + level: { + type: String, + enum: ['Easy Peasy', 'Amateur Chef', 'UltraPro Chef'] + }, + + ingredients: [ String ], + + cuisine: { + type: String, + required: true + }, + + dishType: { + type: String, + enum: [ + 'breakfast', + 'main_course', + 'soup', + 'snack', + 'drink', + 'dessert', + 'other' + ] + }, + + image: { + type: String, + default: "https://images.media-allrecipes.com/images/75131.jpg" + }, + + duration: { + type: Number, + min: 0 + }, + + creator: String, + + created: { + type: Date, + default: Date.now + } }); const Recipe = mongoose.model('Recipe', recipeSchema);