vhp-mongo-models 2.1.5 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Company/company.js +3 -1
- package/Company/schemas/department.js +9 -0
- package/Company/schemas/employee.js +6 -7
- package/Company/schemas/profiles.js +10 -0
- package/HouseHolds/households.js +2 -1
- package/HouseHolds/schemas/checklist.js +7 -5
- package/HouseHolds/schemas/client.js +12 -9
- package/HouseHolds/schemas/home.js +20 -12
- package/HouseHolds/schemas/lead.js +58 -0
- package/HouseHolds/schemas/serviceitem.js +11 -8
- package/Replacement/schemas/bid.js +8 -2
- package/Replacement/schemas/projects.js +17 -7
- package/Service/schemas/activeticket.js +1 -1
- package/Service/schemas/checklistfield.js +4 -10
- package/Service/schemas/checklistform.js +13 -12
- package/Service/schemas/membership.js +5 -0
- package/Service/schemas/subs/final.js +35 -18
- package/Service/schemas/subs/jonaswo.js +5 -3
- package/Service/schemas/subs/ticket.js +26 -16
- package/Service/service.js +2 -1
- package/Systems/schemas/subs/userAppSettings.js +2 -1
- package/Systems/schemas/usersetting.js +3 -1
- package/core-models.js +2 -0
- package/package.json +1 -1
package/Company/company.js
CHANGED
|
@@ -26,5 +26,7 @@ module.exports = {
|
|
|
26
26
|
Employee:Employee,
|
|
27
27
|
Device:Device,
|
|
28
28
|
SIM:new Schema(...require('./schemas/sim.js')),
|
|
29
|
-
Account:new Schema(...require('./schemas/account.js'))
|
|
29
|
+
Account:new Schema(...require('./schemas/account.js')),
|
|
30
|
+
Profile:new Schema(...require('./schemas/profiles.js')),
|
|
31
|
+
Department:new Schema(...require('./schemas/department.js'))
|
|
30
32
|
}
|
|
@@ -17,7 +17,7 @@ module.exports=[
|
|
|
17
17
|
repTo: { type: String, default: '' }, // empID
|
|
18
18
|
title: { type: String, default: '' },
|
|
19
19
|
type:{type:String,default:''},
|
|
20
|
-
teams: { type: Array, default:
|
|
20
|
+
teams: { type: Array, default: [] }, //remove
|
|
21
21
|
jobDesc: { type: String, default: '' },
|
|
22
22
|
|
|
23
23
|
skills: { type: String, default: '' },
|
|
@@ -28,12 +28,11 @@ module.exports=[
|
|
|
28
28
|
bday: { type: Date, default: '' },
|
|
29
29
|
interest: { type: String, default: '' },
|
|
30
30
|
picture: { type: String, default: '' },
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}}
|
|
31
|
+
|
|
32
|
+
email:{type:String,default:''},
|
|
33
|
+
cell:{type:String,default:''},
|
|
34
|
+
desk:{type:String,default:''},
|
|
35
|
+
ext:{type:String,default:''}
|
|
37
36
|
}, {
|
|
38
37
|
toJSON: { virtuals: true },
|
|
39
38
|
toObject: { virtuals: true },
|
package/HouseHolds/households.js
CHANGED
|
@@ -5,5 +5,6 @@ module.exports = {
|
|
|
5
5
|
Home:new Schema(...require('./schemas/home.js')),
|
|
6
6
|
ServiceItem:new Schema(...require('./schemas/serviceitem.js')),
|
|
7
7
|
SIupdate:new Schema(...require('./schemas/siupdate.js')),
|
|
8
|
-
Checklist:new Schema(...require('./schemas/checklist.js'))
|
|
8
|
+
Checklist:new Schema(...require('./schemas/checklist.js')),
|
|
9
|
+
Lead:new Schema(...require('./schemas/lead.js'))
|
|
9
10
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
module.exports = [{
|
|
2
2
|
id:{type:String,default:''}, //unique for THIS checklist
|
|
3
|
-
hhid:{type:String,default:''},
|
|
4
|
-
work:{type:String,default:""}, //just an array of work.id
|
|
5
|
-
custcode:{type:String,default:''},
|
|
6
3
|
name:{type:String,default:''}, //what checklist was used
|
|
7
4
|
title:{type:String,default:''},
|
|
5
|
+
coid:{type:String,default:''},
|
|
6
|
+
hhid:{type:String,default:''},
|
|
7
|
+
work:{type:String,default:''}, //work.id
|
|
8
8
|
sitems:{type:Array,default:[]}, //of service item ["ids"]
|
|
9
9
|
scoring:{
|
|
10
10
|
list:{type:Object,default:{}},
|
|
11
11
|
score:{type:Object,default:{}},
|
|
12
12
|
},
|
|
13
13
|
fields:{type:Object,default:{}}, //to hold all of the checklist values
|
|
14
|
-
notes:{type:Object,default:{}}
|
|
15
|
-
signature:{type:String,default:''}
|
|
14
|
+
notes:{type:Object,default:{}},//notes matching the field "id"
|
|
15
|
+
signature:{type:String,default:''},
|
|
16
|
+
tags:{type:Array,default:[]}, //only the tags peformed
|
|
17
|
+
categories:{type:Array,default:[]} //the workorder categories
|
|
16
18
|
},{minimize:false}]
|
|
@@ -6,23 +6,26 @@
|
|
|
6
6
|
*/
|
|
7
7
|
module.exports = [
|
|
8
8
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
billTo:{type:String,default:''},
|
|
9
|
+
phone: { type: String, default: '' }, // id
|
|
10
|
+
type:{type:String,default:'occupant'}, // owner | occupant
|
|
11
|
+
roles:{type:Array,default:[]},// options resident | AP | maintenance | reception | sales
|
|
13
12
|
custName:{type:String,default:''},
|
|
14
13
|
clientfirst: { type: String, default: '' },
|
|
15
14
|
clientlast: { type: String, default: '' },
|
|
16
|
-
contactName:{type:String,default:''},
|
|
17
|
-
phone: { type: String, default: '' }, // id
|
|
18
15
|
phone2: { type: String, default: '' },
|
|
19
16
|
email: { type: String, default: '' },
|
|
20
|
-
linked: { type: Boolean, default:true},
|
|
21
17
|
createDate: { type: String, default: '' },
|
|
22
18
|
lastTransaction: { type: String, default: '' },
|
|
23
19
|
lastInteraction: { type: String, default: '' },
|
|
24
|
-
|
|
20
|
+
salesRep: { type: String, default: '' },
|
|
21
|
+
notes: {type: String, default:''},
|
|
22
|
+
|
|
23
|
+
//remove
|
|
24
|
+
contactName:{type:String,default:''},
|
|
25
25
|
lead:{type:String,default:''},
|
|
26
|
-
|
|
26
|
+
coid:{type:String,default:''},
|
|
27
|
+
linked: { type: Boolean, default:true}, //remove
|
|
28
|
+
contacts:{type:Array,default:[]}, //remove
|
|
29
|
+
custCode : {type:String,default:''}, //link in Jonas
|
|
27
30
|
}
|
|
28
31
|
]
|
|
@@ -4,16 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
module.exports = [{
|
|
6
6
|
hhid: { type: String, default: '' },
|
|
7
|
-
|
|
7
|
+
type: {type:String, default: ''},//COM | RES
|
|
8
|
+
name: {type:String, default: ''},
|
|
8
9
|
street: { type: String, default: '' },
|
|
9
10
|
unit: { type: String, default: '' },
|
|
10
11
|
city: { type: String, default: '' },
|
|
11
12
|
state: { type: String, default: '' },
|
|
12
13
|
zip: { type: String, default: '' },
|
|
13
14
|
|
|
14
|
-
custid: { type: String, default: '' },
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
custid: { type: String, default: '' }, //phone number / billTo
|
|
16
|
+
occupants: { type: Array, default: [] },
|
|
17
|
+
jonascodes: {type:Array, default: []}, //new add
|
|
18
|
+
billto: {type:Boolean,default: false}, //if it is a billing address for other homes
|
|
19
|
+
salesRep:{type:String,default:''},
|
|
20
|
+
|
|
21
|
+
notes:{type:String,default:''},
|
|
17
22
|
|
|
18
23
|
location: {
|
|
19
24
|
type: Object, default: {
|
|
@@ -27,12 +32,8 @@ module.exports = [{
|
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
eleccomp: '',
|
|
33
|
-
gascomp: ''
|
|
34
|
-
}
|
|
35
|
-
},
|
|
35
|
+
|
|
36
|
+
utilities: {type:Array,default:[]},// gas | electric | water | etc
|
|
36
37
|
measurements: { type: Object, default: {} },
|
|
37
38
|
features: {
|
|
38
39
|
elecService: {
|
|
@@ -69,7 +70,14 @@ module.exports = [{
|
|
|
69
70
|
rooms: { type: Number, default: 0 }
|
|
70
71
|
},
|
|
71
72
|
spaces: { type: Array, default: [] },
|
|
72
|
-
froot: { type: String, default: '' }
|
|
73
73
|
},
|
|
74
74
|
{ minimize: false }
|
|
75
|
-
]
|
|
75
|
+
]
|
|
76
|
+
/**
|
|
77
|
+
* jonascodes = [{
|
|
78
|
+
* coid:{type:String,default:''},
|
|
79
|
+
* custcode:{type:String,default:''},
|
|
80
|
+
* billto:{type:String,default:''}
|
|
81
|
+
* }]
|
|
82
|
+
*
|
|
83
|
+
*/
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* notes = [{
|
|
3
|
+
* takenby:{type:String, default:''},
|
|
4
|
+
* note:{type:String, default:''}
|
|
5
|
+
* }]
|
|
6
|
+
*/
|
|
7
|
+
module.exports = [
|
|
8
|
+
{
|
|
9
|
+
id:{type:String,default:''},
|
|
10
|
+
hhid:{type: String, default:''},
|
|
11
|
+
custid:{type: String, default:''},//person calling in, could be the occupant
|
|
12
|
+
clientfirst:{type:String, default:''},
|
|
13
|
+
clientlast:{type:String, default:''},
|
|
14
|
+
street:{type:String,default:''},
|
|
15
|
+
unit:{type:String,default:''},
|
|
16
|
+
city:{type:String,default:''},
|
|
17
|
+
state:{type:String,default:''},
|
|
18
|
+
zip:{type:String,default:''},
|
|
19
|
+
|
|
20
|
+
status:{type:String,default:'PARENT'}, //PARENT | CHILD
|
|
21
|
+
parent:{type:String,default:''},
|
|
22
|
+
children:{type:Array,default:[]},
|
|
23
|
+
|
|
24
|
+
coid:{type:String,default:''},
|
|
25
|
+
dept:{type:String,default:''},
|
|
26
|
+
workid:{type: String, default:''},//blank until converted TO work (opportunity)
|
|
27
|
+
type:{type: String, default: '' },//PROJECT | SERVICE | MEMBERSHIP
|
|
28
|
+
revenue:{type:Number,default:0},
|
|
29
|
+
|
|
30
|
+
salesRep:{type: String, default:''},
|
|
31
|
+
tags:{type: Array, default:[]},
|
|
32
|
+
result:{type: String, default:'NEW'},//ACTIVE (when converted) | SOLD | CANCELED | NOBUY | REMOVED
|
|
33
|
+
|
|
34
|
+
takenBy:{type:String, default:''},
|
|
35
|
+
takenDate:{type:Date, default:Date.now},
|
|
36
|
+
generator:{type: String, default: '' },//step 1 (SELF | CUSTOMER | SERVICE | REPLACEMENT REFERALS)
|
|
37
|
+
source:{type: String, default: '' }, //optional (user | billboard)
|
|
38
|
+
custref:{type:String,default:''}, //when (SELF | CUSTOMER REFERALS) phone number of refer whether or not they are a customer
|
|
39
|
+
workref:{ //when (SERVICE | REPLACEMENT REFERALS)
|
|
40
|
+
id:{type:String, default:''},
|
|
41
|
+
coid:{type:String, default:''},
|
|
42
|
+
dept:{type:String, default:''},
|
|
43
|
+
type:{type:String, default:''} //SERVICE | PROJECT | MEMBERSHIP
|
|
44
|
+
},
|
|
45
|
+
desc:{type:String,default:''},
|
|
46
|
+
notes:{type:Array, default:[]},
|
|
47
|
+
|
|
48
|
+
apptid:{type:String, default:''},// if an appointment is offically made
|
|
49
|
+
apptdate:{type: Date, default:Date.now},// desired to be serviced/consulted
|
|
50
|
+
|
|
51
|
+
time:{type: String, default: '' }, //time of day
|
|
52
|
+
prstdate:{type: Date, default: '' },
|
|
53
|
+
carryover:{type: Date, default: '' },
|
|
54
|
+
prstvia:{type: String, default: '' },
|
|
55
|
+
rewards:{type: Boolean, default: false }
|
|
56
|
+
},
|
|
57
|
+
{minimize:false}
|
|
58
|
+
]
|
|
@@ -2,14 +2,11 @@ module.exports = [
|
|
|
2
2
|
{
|
|
3
3
|
//VHP ADD fields
|
|
4
4
|
hhid:{type:String,default:''}, //must have a hhid
|
|
5
|
+
coid:{type:String,default:''},//need to link from JONAS
|
|
5
6
|
group:{type:String,default:''},//names the type of product it is. Would like to use this instead of type
|
|
6
|
-
|
|
7
|
-
space:{type:String,default:''},
|
|
8
|
-
considerreplace:{type:Boolean,default:false},
|
|
9
|
-
subspace:{type:String,default:''},
|
|
7
|
+
considerreplace:{type:Date,default:''},
|
|
10
8
|
quantity:{type:Number,default:1}, //optional qty
|
|
11
9
|
notes:{type:Array,default:[]},// for better history {tech:'',date:'',ticketId:''}
|
|
12
|
-
edits:{type:Object,defualt:{}}, //to track all of the fields that have been changed since sync
|
|
13
10
|
tags:{type:Array,default:[]},
|
|
14
11
|
|
|
15
12
|
//JONAS props
|
|
@@ -20,13 +17,13 @@ module.exports = [
|
|
|
20
17
|
descr:{type:String,default:''},
|
|
21
18
|
status:{type:String,default:''},//should be 'A' for active. Need to find other codes. Match JONAS
|
|
22
19
|
insdate:{type:Date,default:''},
|
|
23
|
-
|
|
20
|
+
|
|
24
21
|
model:{type:String,default:''},
|
|
25
22
|
serial:{type:String,default:''},
|
|
26
23
|
manf:{type:String,default:''},
|
|
27
24
|
|
|
28
25
|
location:{type:String,default:''},//remove, same as space / sub space
|
|
29
|
-
area:{type:String,default:''},//
|
|
26
|
+
area:{type:String,default:''},//
|
|
30
27
|
|
|
31
28
|
controls:{type:String,default:''},
|
|
32
29
|
elec:{type:String,default:''},
|
|
@@ -38,7 +35,7 @@ module.exports = [
|
|
|
38
35
|
expry1:{type:Date,default:''},
|
|
39
36
|
expry2:{type:Date,default:''},
|
|
40
37
|
expry3:{type:Date,default:''},
|
|
41
|
-
|
|
38
|
+
|
|
42
39
|
//Custom Info
|
|
43
40
|
filt1:{type:String,default:''},
|
|
44
41
|
filt1q:{type:String,default:'0'},
|
|
@@ -46,6 +43,12 @@ module.exports = [
|
|
|
46
43
|
filt2q:{type:String,default:'0'},
|
|
47
44
|
filt3:{type:String,default:''},
|
|
48
45
|
filt3q:{type:String,default:''}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// edits:{type:Object,defualt:{}}, //to track all of the fields that have been changed since sync
|
|
49
|
+
// system:{type:String,default:''}, //way to link related service items
|
|
50
|
+
// space:{type:String,default:''},
|
|
51
|
+
// subspace:{type:String,default:''},
|
|
49
52
|
},
|
|
50
53
|
{minimize:false}
|
|
51
54
|
]
|
|
@@ -16,24 +16,30 @@
|
|
|
16
16
|
paid:{type:Date,default:''}
|
|
17
17
|
* }]
|
|
18
18
|
*/
|
|
19
|
+
|
|
19
20
|
module.exports=[
|
|
20
21
|
{
|
|
21
22
|
projectId:{type:String,default:''}, //was ref
|
|
22
23
|
hhid:{type:String,default:''}, //new
|
|
23
24
|
dept:{type:String,default:''},
|
|
24
25
|
contract:{type:String,default:''},//no contract it can't be sold
|
|
26
|
+
|
|
25
27
|
solution:{type:String,default:''}, //type-<solution>
|
|
28
|
+
|
|
26
29
|
cat:{type:String,default:''},
|
|
27
30
|
type:{type:String,default:''},
|
|
28
31
|
bookprice:{type:Boolean,default:true},
|
|
32
|
+
|
|
29
33
|
amntTotal:{type:Number,default:0},
|
|
30
34
|
amntCust:{type:Number,default:0},
|
|
31
35
|
amntAmeren:{type:Number,default:0},
|
|
32
36
|
amntManf:{type:Number,default:0},
|
|
33
37
|
amntSpecial:{type:Number,default:0},
|
|
34
|
-
|
|
38
|
+
|
|
35
39
|
sold:{type:Date,default:''},
|
|
36
40
|
invoiced:{type:Date,default:''},
|
|
37
|
-
paid:{type:Date,default:''}
|
|
41
|
+
paid:{type:Date,default:''},
|
|
42
|
+
comped:{type:Date,default:''},
|
|
43
|
+
items:{type:Array,default:[]}
|
|
38
44
|
}
|
|
39
45
|
]
|
|
@@ -22,6 +22,7 @@ let pvvisit = {
|
|
|
22
22
|
scheduled: { type: Boolean }
|
|
23
23
|
}
|
|
24
24
|
let lead = {
|
|
25
|
+
id:{type:String,default:''},
|
|
25
26
|
apptdate: { type: Date, default: '' },
|
|
26
27
|
type: { type: String, default: '' },
|
|
27
28
|
prstdate: { type: Date, default: '' },
|
|
@@ -44,7 +45,8 @@ let info = {
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/** Projects Schema
|
|
47
|
-
*
|
|
48
|
+
*
|
|
49
|
+
{
|
|
48
50
|
"dept": 1,
|
|
49
51
|
"hhid": 1,
|
|
50
52
|
"status": 1
|
|
@@ -54,15 +56,12 @@ let info = {
|
|
|
54
56
|
*/
|
|
55
57
|
module.exports = [
|
|
56
58
|
{
|
|
59
|
+
cleanTag: {type:Object,default:{}},
|
|
57
60
|
id: { type: String, default: '' },
|
|
58
61
|
name: { type: String, default: '' },
|
|
59
62
|
coid: { type: String, default: '' },
|
|
60
63
|
jobnum: { type: String, default: '' },
|
|
61
|
-
ref: { type: String, default: '' },
|
|
62
64
|
hhid: { type: String, default: '' },
|
|
63
|
-
clientfirst: { type: String, default: '' },
|
|
64
|
-
clientlast: { type: String, default: '' },
|
|
65
|
-
...aaddress,
|
|
66
65
|
...acontact,
|
|
67
66
|
estimator: { type: String, default: 'unassigned' },
|
|
68
67
|
schedule: { type: Array, default: [] },
|
|
@@ -76,8 +75,12 @@ module.exports = [
|
|
|
76
75
|
info: info,
|
|
77
76
|
contracts: { type: Array, default: [] },
|
|
78
77
|
lead: lead,
|
|
79
|
-
refs: { type: Array, default: [] },
|
|
80
|
-
froot: { type: String, default: '' }
|
|
78
|
+
refs: { type: Array, default: [] }, //do we need?
|
|
79
|
+
froot: { type: String, default: '' },
|
|
80
|
+
//joblog to be added to flat
|
|
81
|
+
|
|
82
|
+
...aaddress, //remove
|
|
83
|
+
// ref: { type: String, default: '' },
|
|
81
84
|
},
|
|
82
85
|
{
|
|
83
86
|
toJSON: { virtuals: true },
|
|
@@ -85,3 +88,10 @@ module.exports = [
|
|
|
85
88
|
minimize: false
|
|
86
89
|
}
|
|
87
90
|
]
|
|
91
|
+
/**
|
|
92
|
+
* schedule = [{
|
|
93
|
+
* type
|
|
94
|
+
* }]
|
|
95
|
+
*
|
|
96
|
+
*
|
|
97
|
+
*/
|
|
@@ -5,7 +5,7 @@ module.exports = [
|
|
|
5
5
|
{
|
|
6
6
|
...aticket,
|
|
7
7
|
status: { type: String, default: 'active' },
|
|
8
|
-
documents: { type: Array, default: [] },
|
|
8
|
+
documents: { type: Array, default: [] }, //remove?
|
|
9
9
|
approval:{type:String,default:'PREPARING'}, // SENT | APPROVED
|
|
10
10
|
approvalCode:{type:String,default:''}
|
|
11
11
|
},{minimize:false}
|
|
@@ -24,22 +24,16 @@
|
|
|
24
24
|
module.exports=[{
|
|
25
25
|
id:{type:String,default:''},
|
|
26
26
|
building:{type:String,default:''}, // COM | RES
|
|
27
|
-
//class:{type:String,default:''}, //remove is now id
|
|
28
|
-
|
|
29
|
-
type:{type:Object,default:{}},
|
|
30
|
-
title:{type:Object,default:{}},
|
|
31
27
|
desc:{type:String,default:''},
|
|
32
28
|
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
//all of the below are organized {<thing>:<associated thing per that thing>}
|
|
30
|
+
title:{type:Object,default:{}},
|
|
31
|
+
type:{type:Object,default:{}},
|
|
32
|
+
tags:{type:Object,default:{}},
|
|
37
33
|
input:{type:Object,default:{}},
|
|
38
34
|
required:{type:Object,default:{}},
|
|
39
35
|
present:{type:Object,default:{}},
|
|
40
36
|
scoring:{type:Object,default:{}},
|
|
41
37
|
calc:{type:Object,default:{}},
|
|
42
|
-
shared:{type:Boolean,default:true},
|
|
43
|
-
rewards:{type:Boolean,default:false},
|
|
44
38
|
notes:{type:Object,default:{}}
|
|
45
39
|
},{minimize:false}]
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
module.exports = [{
|
|
2
2
|
name:{type:String,default:''},
|
|
3
3
|
title:{type:String,default:''},
|
|
4
|
+
coid:{type:String,default:''}, //what company can use it, none means all
|
|
5
|
+
depts:{type:Array,default:[]}, //what departments can use them, none means all
|
|
6
|
+
categories:{type:Array,default:[]}, //the workorder categories from JONAS
|
|
7
|
+
building:{type:String,default:''}, //RES | COM
|
|
4
8
|
desc:{type:String,default:''},
|
|
5
|
-
|
|
6
|
-
groups:{type:Array,default:[]},
|
|
9
|
+
|
|
7
10
|
included:{type:Array,default:[]},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
tags:{type:Array,default:[]}, //a way to filter field.tag
|
|
12
|
+
color:{type:String,default:''},
|
|
13
|
+
scoring:{type:Array,default:[]}, //was categories
|
|
11
14
|
scored:{type:Boolean,default:false},
|
|
12
|
-
enabled:{type:Boolean,default:true},
|
|
13
|
-
tags:{type:Array,default:[]},
|
|
14
15
|
grades:{type:Array,default:[]},
|
|
16
|
+
|
|
17
|
+
autoadd:{type:Boolean,default:false}, //jobinfo...
|
|
18
|
+
finish:{type:Boolean,default:false},
|
|
19
|
+
enabled:{type:Boolean,default:true}, //whether its active
|
|
15
20
|
present:{type:Boolean,default:true},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//sitemTags:{type:Array,default:[]},
|
|
19
|
-
rewards:{type:Boolean,default:false},
|
|
20
|
-
signature:{type:Boolean,default:false},
|
|
21
|
+
signature:{type:Boolean,default:false} //if a signature is required to complete
|
|
21
22
|
},{minimize:false}]
|
|
@@ -10,16 +10,18 @@ let repairEstimate = {
|
|
|
10
10
|
techCount:{type:Number,default:0},
|
|
11
11
|
revenuePer:{type:Number,default:0}, //was revenuePerEstimate
|
|
12
12
|
completionTime:{type:String,default:''}
|
|
13
|
+
|
|
13
14
|
//revenuePerEstimate:{type:Number,default:0},
|
|
14
15
|
//revenuePer:{type:Number,default:0},//moved to ticketTime
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
let ticketTime = {
|
|
18
|
-
|
|
19
|
+
crossLaborRate:{type:Number,default:0},
|
|
20
|
+
techs:{type:Number,default:0},
|
|
19
21
|
driving:{type:Number,default:0},
|
|
20
22
|
labor:{type:Number,default:0},
|
|
21
|
-
start:{type:Date,default:
|
|
22
|
-
end:{type:Date,default:
|
|
23
|
+
start:{type:Date,default:''},
|
|
24
|
+
end:{type:Date,default:''},
|
|
23
25
|
hours:{type:Number,default:0},
|
|
24
26
|
revenuePer:{type:Number,default:0}
|
|
25
27
|
}
|
|
@@ -30,38 +32,53 @@ let conform = {
|
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
let ticketFinal = {
|
|
33
|
-
showReplacement:{type:Boolean,default:false},
|
|
34
35
|
summary:{type:Object,default:{}}, //a static version of the presentation
|
|
36
|
+
approved:{type:Array,default:[]},
|
|
35
37
|
conform:conform,
|
|
36
38
|
invoice:ticketInvoice,
|
|
37
|
-
|
|
38
|
-
emailed:{type:Boolean,default:false},
|
|
39
|
-
//paymentMethod:{type:String,default:''},
|
|
39
|
+
emailed:{type:Array,default:[]}, //was boolean
|
|
40
40
|
returnVisit:{type:String,default:''}, //change to String, and attach return ticket id
|
|
41
41
|
returnNotes:{type:String,default:''},
|
|
42
|
-
//addlDetails:{type:String,default:''},
|
|
43
|
-
serviceReferral:{type:Boolean,default:false},
|
|
44
42
|
repairEstimate:repairEstimate, //was ticketTime
|
|
45
43
|
ticketTime:ticketTime,
|
|
46
|
-
timelog:{type:Object,default:{}},
|
|
47
|
-
officeSubmit:{type:String,default:''},
|
|
48
44
|
completedBy:{type:String,default:''}, //was type=Array
|
|
49
|
-
afterHours:{type:Boolean,default:false}
|
|
45
|
+
afterHours:{type:Boolean,default:false},
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
showReplacement:{type:Boolean,default:false}, //may not need
|
|
49
|
+
serviceReferral:{type:Boolean,default:false}, //may not need
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// signature:{type:String,default:''},
|
|
53
|
+
// officeSubmit:{type:String,default:''},
|
|
54
|
+
//addlDetails:{type:String,default:''},
|
|
55
|
+
//timelog:{type:Object,default:{}},
|
|
56
|
+
//paymentMethod:{type:String,default:''},
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
module.exports = ticketFinal
|
|
53
60
|
|
|
54
61
|
/*
|
|
55
|
-
|
|
56
|
-
<tech>:[{driveTime,startTime,endTime}]
|
|
62
|
+
ticketTime.techs = {
|
|
57
63
|
}
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
emailed = [{
|
|
67
|
+
date:{type:Date,default:''},
|
|
68
|
+
to:{type:Array,default:[]},
|
|
69
|
+
type:{type:String,default:''} // approval | final
|
|
70
|
+
}]
|
|
71
|
+
approved = [{
|
|
72
|
+
name:{type:String,default:''},
|
|
73
|
+
date:{type:Date,default:''},
|
|
74
|
+
signature:{type:String,default:''}
|
|
75
|
+
}]
|
|
76
|
+
|
|
60
77
|
summary = {
|
|
61
|
-
approved:{
|
|
78
|
+
approved:[{
|
|
62
79
|
name:{type:String,default:''},
|
|
63
80
|
signature:{type:String,default:''}
|
|
64
|
-
}
|
|
81
|
+
}]
|
|
65
82
|
total:{
|
|
66
83
|
mprice:{type:Number,default:0},
|
|
67
84
|
rprice:{type:Number,default:0},
|
|
@@ -6,6 +6,8 @@ module.exports = {
|
|
|
6
6
|
contactemail:{type:String,default:''},
|
|
7
7
|
customername:{type:String,default:''},
|
|
8
8
|
descr:{type:String,default:''},
|
|
9
|
+
dispatchnotes:{type:String,default:''},
|
|
10
|
+
technotes:{type:String,default:''},
|
|
9
11
|
street:{type:String,default:''},
|
|
10
12
|
cityzip:{type:String,default:''},
|
|
11
13
|
unit:{type:String,default:''},
|
|
@@ -19,14 +21,14 @@ module.exports = {
|
|
|
19
21
|
conref:{type:String,default:''},
|
|
20
22
|
ref:{type:String,default:''},
|
|
21
23
|
pricebook:{type:String,default:''},
|
|
22
|
-
pricelevel:{type:String,default:''},
|
|
24
|
+
pricelevel:{type:String,default:'STA'},
|
|
23
25
|
salesrep:{type:String,default:''},
|
|
24
26
|
tech:{type:String,default:''},
|
|
25
|
-
datecall:{type:Date,default:
|
|
27
|
+
datecall:{type:Date,default:Date.now},
|
|
26
28
|
timecall:{type:String,default:''},
|
|
27
29
|
dateorder:{type:Date,default:''},
|
|
28
30
|
timeorder:{type:String,default:''},
|
|
29
|
-
dateschedule:{type:Date,default:
|
|
31
|
+
dateschedule:{type:Date,default:Date.now},
|
|
30
32
|
timeschedule:{type:String,default:''},
|
|
31
33
|
datearrival:{type:Date,default:''},
|
|
32
34
|
timearrival:{type:String,default:''},
|
|
@@ -6,6 +6,7 @@ const ticketFinal = require('./final.js')
|
|
|
6
6
|
[
|
|
7
7
|
<user>:{
|
|
8
8
|
name:{type:String,default:''},
|
|
9
|
+
coid:{type:String,default:''},
|
|
9
10
|
assigned:{
|
|
10
11
|
<sitem.id>:{
|
|
11
12
|
id:{type:String,default:''}, //the service item id
|
|
@@ -20,11 +21,17 @@ const ticketFinal = require('./final.js')
|
|
|
20
21
|
}]}
|
|
21
22
|
}
|
|
22
23
|
}]},
|
|
24
|
+
|
|
25
|
+
//for activetickets
|
|
23
26
|
driveTime:{type:Date,default:''},
|
|
24
27
|
startTime:{type:Date,default:''},
|
|
25
28
|
endTime:{type:Date,default:''},
|
|
26
29
|
adjustTime:{type:Number,default:0},
|
|
30
|
+
|
|
31
|
+
//for completetickets
|
|
32
|
+
totalDrive:{type:Number,default:0},
|
|
27
33
|
totalTime:{type:Number,default:0},
|
|
34
|
+
|
|
28
35
|
complete:{type:Boolean,default:false},
|
|
29
36
|
revenue:{
|
|
30
37
|
perHour:{type:Number,default:0}, //techs revenue per hour based on their repairs
|
|
@@ -44,36 +51,39 @@ const ticketFinal = require('./final.js')
|
|
|
44
51
|
appr:{type:String,default:'PENDING'}, // 'YES' | 'NO'
|
|
45
52
|
done:{type:Boolean,default:false},
|
|
46
53
|
note:{type:String,default:''}
|
|
47
|
-
|
|
54
|
+
returnfor:{type:Boolean,default:false}
|
|
48
55
|
}]
|
|
49
56
|
}
|
|
50
57
|
*/
|
|
51
58
|
module.exports = {
|
|
52
|
-
id: { type: String, default: '' },
|
|
59
|
+
id: { type: String, default: '' }, // <00><wonum>
|
|
60
|
+
wonum:{type:String,default:''}, //the wonum from jonas. relative to the the company
|
|
61
|
+
coid:{type:String,default:''},
|
|
62
|
+
hhid:{type:String,default:''},
|
|
63
|
+
returnVisit:{type:String,default:''},//used for the ticket returning for's id
|
|
53
64
|
ref: { type: Object, default: {} },
|
|
54
65
|
custid: {type:String, default:''},
|
|
55
66
|
cat:{type:String,default:''}, //converted cat from jonas. Orginal cat can be found in wo.cat
|
|
56
67
|
dept:{type:String,default:''},
|
|
57
|
-
|
|
68
|
+
temp:{type:Boolean,default:false},
|
|
58
69
|
techs: { type: Array, default: [] },
|
|
59
70
|
techinfo: {type:Object, default:{}}, //hold all info on techs involved
|
|
71
|
+
timelog: {type:Array, default:[]},
|
|
72
|
+
|
|
60
73
|
salesrep:{type:String,default:''},
|
|
61
74
|
|
|
62
|
-
|
|
63
|
-
...aaddress, //do not need?
|
|
64
|
-
|
|
75
|
+
sitems: { type: Array, default: [] },
|
|
65
76
|
checks: { type: Object, default: {} },
|
|
66
77
|
repairs: { type: Object, default: {} },
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
todo: {type:Object,default:{}},//used for all todos in workflow.
|
|
70
|
-
//remove the following and merge into 'todo' with a type
|
|
71
|
-
office: { type: Object, default: {} },//any todo items for the office
|
|
72
|
-
field: {type:Object,default:{}},//any todo items for the field
|
|
73
|
-
|
|
78
|
+
|
|
79
|
+
todo: {type:Object,default:{}},//was office
|
|
74
80
|
final: ticketFinal,
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
|
|
77
82
|
wo: wo,
|
|
78
|
-
logs:{type:Array,default:[]} //match with project datelog. Would like it to stay as "logs" though
|
|
83
|
+
logs:{type:Array,default:[]}, //match with project datelog. Would like it to stay as "logs" though
|
|
84
|
+
|
|
85
|
+
//Remove
|
|
86
|
+
// contract: { type: Object, default: {} }, // the contract attached to the client. Should move off of WO into separate query
|
|
87
|
+
// office: { type: Object, default: {} },//any todo items for the office
|
|
88
|
+
// field: {type:Object,default:{}},//any todo items for the field
|
|
79
89
|
}
|
package/Service/service.js
CHANGED
|
@@ -7,5 +7,6 @@ module.exports = {
|
|
|
7
7
|
SpiffReport:new Schema(...require('./schemas/spiffreport.js')),
|
|
8
8
|
ChecklistForm:new Schema(...require('./schemas/checklistform.js')),
|
|
9
9
|
ChecklistField:new Schema(...require('./schemas/checklistfield.js')),
|
|
10
|
-
ChecklistCalc:new Schema(...require('./schemas/checklistcalc.js'))
|
|
10
|
+
ChecklistCalc:new Schema(...require('./schemas/checklistcalc.js')),
|
|
11
|
+
Membership:new Schema(...require('./schemas/membership.js'))
|
|
11
12
|
}
|
|
@@ -33,11 +33,12 @@ const appsetup = {
|
|
|
33
33
|
canContactClient:false
|
|
34
34
|
},
|
|
35
35
|
projects:{
|
|
36
|
+
types:[], //HVAC,WINDOW,ENVELOPE
|
|
36
37
|
canCreate:false,
|
|
37
38
|
canEdit:false,
|
|
38
39
|
canRemove:false,
|
|
39
40
|
canApprove:false,
|
|
40
|
-
canQuote:false
|
|
41
|
+
canQuote:false,//trim
|
|
41
42
|
canPayCommission:false
|
|
42
43
|
},
|
|
43
44
|
service:{
|
|
@@ -13,7 +13,8 @@ module.exports=[
|
|
|
13
13
|
profile:{type:String,default:''},//optional to connect to a UserProfile
|
|
14
14
|
|
|
15
15
|
...userSetup, //holds all lists and switchs. can be overwritten by profile
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
types:{type:Array,default:[]}, //'TECH', 'CONSULTANT', 'CSR', 'DISPATCH', '
|
|
17
18
|
preferences:{type:Object,default:{//to hold items "tweakable" from the portal
|
|
18
19
|
system:{
|
|
19
20
|
darkMode:false,
|
|
@@ -25,6 +26,7 @@ module.exports=[
|
|
|
25
26
|
departments:[]
|
|
26
27
|
},
|
|
27
28
|
home:{
|
|
29
|
+
type:[],//COM | RES
|
|
28
30
|
favorites:[],
|
|
29
31
|
links:[],
|
|
30
32
|
carousel:[]
|
package/core-models.js
CHANGED
|
@@ -6,6 +6,8 @@ let addressCore={
|
|
|
6
6
|
zip: { type: String, default: '' }
|
|
7
7
|
}
|
|
8
8
|
let contactCore={
|
|
9
|
+
clientfirst: { type: String, default: '' },
|
|
10
|
+
clientlast: { type: String, default: '' },
|
|
9
11
|
contact:{type:String,default:''}, //
|
|
10
12
|
phone:{type:String,default:''},
|
|
11
13
|
email:{type:String,default:''}
|