More stuff

This commit is contained in:
Dobie Wollert
2015-11-25 02:29:23 -08:00
parent f5bc55b1f5
commit f9c9672818
8 changed files with 786 additions and 19 deletions

View File

@ -0,0 +1,58 @@
"use strict";
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.ObjectId;
var schema = new Schema({
user: {
type: ObjectId,
ref: 'User'
},
client: {
type: ObjectId,
ref: 'Client'
},
workorder: {
type: ObjectId,
ref: 'Workorder'
},
status: {
type: String,
enum: ['open', 'closed']
},
start: {
type: Date
},
end: {
type: Date
},
duration: {
type: Number,
min: 0
},
type: {
type: String,
enum: [ 'workorder', 'workday', 'nonBillable' ]
},
reason: {
type: String,
enum: ['shop', 'break', 'pto', 'meeting', 'event', 'weather', 'holiday']
},
notes: {
type: String,
trim: true
}
});
module.exports = mongoose.model('TimeClockSpan', schema);