Added a bunch of stuff

This commit is contained in:
Dobie Wollert
2015-08-05 06:03:02 -07:00
parent b4e727c0e6
commit fdc8727044
35 changed files with 1815 additions and 276 deletions

11
app/model/checkList.js Normal file
View File

@ -0,0 +1,11 @@
var mongoose = require('mongoose')
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var checkListSchema = new Schema({
name: String,
fields: [{}],
deleted: { type: Boolean, default: false }
});
module.exports = mongoose.model('CheckList', checkListSchema);

View File

@ -11,6 +11,8 @@ var deviceSchema = new Schema({
purchaseDate: Date,
warrantyExpiration: Date,
location: String,
frequencyType: String,
frequencySchedule: [],
deleted: { type: Boolean, default: false }
});

View File

@ -10,6 +10,7 @@ var deviceTypeSchema = new Schema({
links: String,
partsRecommended: String,
images: [{ type: String }],
checkList: { type: ObjectId, ref: 'CheckList' },
deleted: { type: Boolean, default: false }
});

14
app/model/testRun.js Normal file
View File

@ -0,0 +1,14 @@
var mongoose = require('mongoose')
Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var testRunSchema = new Schema({
device: { type: ObjectId, ref: 'Device' },
fields: [{}],
date: Date,
result: Boolean,
comment: String,
deleted: { type: Boolean, default: false }
});
module.exports = mongoose.model('TestRun', testRunSchema);

View File

@ -30,7 +30,8 @@ var workorderSchema = new Schema({
checkNumber: String,
paidOn: Date,
alternativeContact: String,
trackingNumber: String
trackingNumber: String,
devices: [{ type: ObjectId, ref: 'Device' }]
});
module.exports = mongoose.model('Workorder', workorderSchema);