merchant.js 542 B

12345678910111213141516171819202122232425
  1. const mongoose = require("mongoose");
  2. const MerchantSchema = new mongoose.Schema({
  3. cloverId: {
  4. type: String,
  5. required: true
  6. },
  7. lastUpdatedTime: {
  8. type: Date,
  9. default: Date.now
  10. },
  11. recipes: [{
  12. type: mongoose.Schema.Types.ObjectId,
  13. ref: "Recipe"
  14. }],
  15. ingredients: [{
  16. id: {
  17. type: mongoose.Schema.Types.ObjectId,
  18. ref: "Ingredient"
  19. },
  20. quantity: String
  21. }]
  22. });
  23. module.exports = mongoose.model("Merchant", MerchantSchema);