MWA course CS-573-2020-Group3
Farmer = {
_id: Object,
user: Object,
firstName: String,
lastName: String,
tel: String,
address: String,
reputation: Integer
}
Product = {
_id: Object,
farmer: {type: Schema.Types.ObjectId, ref: 'Farmer'},
name: String,
description: String,
price: Double,
photo: String,
...,
inStock: Interger
}
Order = {
_id: Object,
customer: {type: Schema.Types.ObjectId, ref: 'Customer'},,
farmer: {type: Schema.Types.ObjectId, ref: 'Farmer'},,
orderCode: String,
createDate: { type: Date, default: Date.now },
orderItems: [Product],
status: (PENDING || READY || COMPLETE),
totalAmount: Double,
pickUpTime: DateTime,
rate: (null||EXCELLENT||GOOD||BAD)
}
Customer = {
_id: Object,
user: Object,
firstName: String,
lastName: String,
tel: String,
address: String
}
User = {
_id: Object
email: String,
password: String,
role: (ADMIN|FARMER|CUSTOMER),
uid: String, // FarmerId or CustomerId
status: (ACTIVE||DEACTIVE)
}