var mongoose = require('mongoose'),
    Schema = mongoose.Schema;

var Item = require('../models/item-model.js');

var bagSchema = new mongoose.Schema({
	sn: String,
    items: [{Item , quantity: Number}],
    price: String,
	created_at: {type: Date, default: Date.now},
    lastEdited_at: {type: Date, default: Date.now}
});

module.exports = mongoose.model('Bag', bagSchema);
var mongoose = require('mongoose'),
    Schema = mongoose.Schema;

var Item = require('../models/item-model.js');

var bagSchema = new mongoose.Schema({
	sn: String,
    items: [{new Item , quantity: Number}],
    price: String,
	created_at: {type: Date, default: Date.now},
    lastEdited_at: {type: Date, default: Date.now}
});

module.exports = mongoose.model('Bag', bagSchema);
change Item to new Item