acmucsd-projects / su23-hack-team-1

Web App for food management through a food pantry system.
1 stars 1 forks source link

not sure if correct but edited addunit schema to include missed factors #6

Open hjordynf opened 1 year ago

hjordynf commented 1 year ago

heres the code

const mongoose = require("mongoose");

const AddUnitSchema = new mongoose.Schema({ item:{ type: String, enum: ['Meat','Poultry','Vegetables','Fruit'], required: true, }, storeInFridge:{ type: String, enum: ['Yes','No','Deep Fridge'], required: true, }, purchaseDate:{ type: Number, purchaseDate: Date, required: true, }, expiryDate:{ type: Number, expirationDate: Date, required: true, }, amountOfItem:{ amount:{ type: Number, required: true, }, unit:{ type: String, enum: ['Kg','Lbs','actual item'], required: true, }, }, })

const AddUnitModel = mongoose.model("Add Unit", AddUnitSchema); module.exports = AddUnitModel;

hjordynf commented 1 year ago

still need to implement into mongodb

pviwatkurkul commented 1 year ago

Looks good, I will test in postman at some point