Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Model: Estimate Line Item
- */
- var EstimateLineItemSchema = new Schema({
- 'name' : String,
- 'description' : String,
- 'quantity' : Number,
- 'cost' : Number
- });
- console.log("EstimateLineItemSchema: ", EstimateLineItemSchema);
- var EstimateLineItem = db.model('EstimateLineItem', EstimateLineItemSchema);
- /**
- * Model: Estimate
- */
- var EstimateSchema = new Schema({
- 'name' : String,
- 'subTotal' : Number,
- 'finalTotal' : Number,
- 'creationDate' : { type: Date, default: Date.now },
- 'status' : { type: String, default: "Active" },
- 'lineItemSet' : [EstimateLineItem]
- });
- console.log("EstimateSchema: ", EstimateSchema);
- var Estimate = db.model('Estimate', EstimateSchema);
- /**
- * Model: Job
- */
- var JobSchema = new Schema({
- 'name' : String,
- 'description' : String,
- 'creationDate' : { type: Date, default: Date.now },
- 'status' : { type: String, default: "Active" },
- 'scheduleDates' : String,
- 'customerID' : schemaObjectId,
- 'estimateSet' : [Estimate]
- });
- console.log("JobSchema: ", JobSchema);
- var Job = db.model('Job', JobSchema);
Advertisement
Add Comment
Please, Sign In to add comment