vhp-mongo-models 2.1.991 → 2.1.993
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.
|
@@ -14,7 +14,7 @@ module.exports = [{
|
|
|
14
14
|
|
|
15
15
|
board: { type: String, default: '' },
|
|
16
16
|
type: { type: String, default: '' }, // 'follow-up' | 'consultation' | 'install' | 'meeting' | 'special
|
|
17
|
-
tags: { type: Array, default: [] },
|
|
17
|
+
tags: { type: Array, default: [] }, //basically categories would either align with the JONAS categories OR be add to the portal ie 'Consult'
|
|
18
18
|
|
|
19
19
|
title: { type: String, default: '' },
|
|
20
20
|
descr: { type: String, default: '' },
|
|
@@ -2,48 +2,48 @@ const { Schema } = require('mongoose')
|
|
|
2
2
|
const { aaddress, acontact } = require('../../core-models.js');
|
|
3
3
|
|
|
4
4
|
let pvmaint = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
contractNum: { type: String, default: '' },
|
|
6
|
+
rewardNum: { type: String, default: '' },
|
|
7
|
+
jobref: { type: String, default: '' },
|
|
8
|
+
custCode: { type: String, default: '' },
|
|
9
|
+
custName: { type: String, default: '' },
|
|
10
|
+
street: { type: String, default: '' },
|
|
11
|
+
city: { type: String, default: '' },
|
|
12
|
+
state: { type: String, default: '' },
|
|
13
|
+
zip: { type: String, default: '' },
|
|
14
|
+
visits: { type: Array, default: [] }
|
|
15
15
|
}
|
|
16
16
|
let pvvisit = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
type: { type: String }, //Cooling | Heating
|
|
18
|
+
date: { type: Date },
|
|
19
|
+
check: { type: Boolean },
|
|
20
|
+
notes: { type: String },
|
|
21
|
+
photos: { type: Boolean },
|
|
22
|
+
scheduled: { type: Boolean }
|
|
23
23
|
}
|
|
24
24
|
let lead = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
id: { type: String, default: '' }, //sync with lead
|
|
26
|
+
apptdate: { type: Date, default: '' }, //sync with lead
|
|
27
|
+
type: { type: String, default: '' },
|
|
28
|
+
prstdate: { type: Date, default: '' },
|
|
29
|
+
callTypes: { type: Array, default: [] },
|
|
30
|
+
time: { type: String, default: '' },
|
|
31
|
+
carryover: { type: Date, default: '' },
|
|
32
|
+
prstvia: { type: String, default: '' },
|
|
33
|
+
rewards: { type: Boolean, default: false }, //sync with lead
|
|
34
|
+
source: { type: String, default: '' }, //sync with lead
|
|
35
|
+
generator: { type: String, default: '' }, //sync with lead
|
|
36
|
+
|
|
37
|
+
soldAmount: { type: Number, default: 0 }, //remove? would use bid
|
|
38
|
+
paid: { type: Date, default: '' } //remove? would use bid
|
|
39
39
|
}
|
|
40
40
|
let info = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
pkids: { type: Array, default: [] },
|
|
42
|
+
spaces: { type: Array, default: [] },
|
|
43
|
+
summary: { type: Object, default: {} },
|
|
44
|
+
quotes: { type: Object, default: {} },
|
|
45
|
+
joblog: { type: Object, default: {} },
|
|
46
|
+
pvmaint: pvmaint,
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/** Projects Schema
|
|
@@ -57,38 +57,38 @@ let info = {
|
|
|
57
57
|
* - id - {unique:true,name:"id"}
|
|
58
58
|
*/
|
|
59
59
|
module.exports = [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
60
|
+
{
|
|
61
|
+
cleanTag: { type: Object, default: {} },
|
|
62
|
+
id: { type: String, default: '' },
|
|
63
|
+
name: { type: String, default: '' },
|
|
64
|
+
coid: { type: String, default: '' },
|
|
65
|
+
jobnum: { type: String, default: '' },
|
|
66
|
+
hhid: { type: String, default: '' },
|
|
67
|
+
...acontact,
|
|
68
|
+
estimator: { type: String, default: 'unassigned' },
|
|
69
|
+
schedule: { type: Array, default: [] },
|
|
70
|
+
dept: { type: String, default: '' },
|
|
71
|
+
stage: { type: String, default: 'quote' },
|
|
72
|
+
status: { type: String, default: 'active' },
|
|
73
|
+
opendate: { type: Date, default: Date.now() },
|
|
74
|
+
lastdate: { type: Date, default: Date.now() },
|
|
75
|
+
closedate: { type: Date, default: '' },
|
|
76
|
+
datelog: { type: Array, default: [] },
|
|
77
|
+
info: info,
|
|
78
|
+
contracts: { type: Array, default: [] },
|
|
79
|
+
lead: lead,
|
|
80
|
+
refs: { type: Array, default: [] }, //do we need?
|
|
81
|
+
froot: { type: String, default: '' },
|
|
82
|
+
//joblog to be added to flat
|
|
83
|
+
|
|
84
|
+
...aaddress, //remove
|
|
85
|
+
// ref: { type: String, default: '' },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
toJSON: { virtuals: true },
|
|
89
|
+
toObject: { virtuals: true },
|
|
90
|
+
minimize: false
|
|
91
|
+
}
|
|
92
92
|
]
|
|
93
93
|
/**
|
|
94
94
|
* schedule = [{
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = [{
|
|
2
|
+
ticket:{type:String,default:''},
|
|
3
|
+
hhid:{type:String,default:''},
|
|
4
|
+
date:{type:Date,default:''},
|
|
5
|
+
task:{type:String,default:''},
|
|
6
|
+
descr:{type:String,default:''},
|
|
7
|
+
price:{type:Number,default:0},
|
|
8
|
+
pl:{type:String,default:''},
|
|
9
|
+
appr:{type:String,default:''},
|
|
10
|
+
qty:{type:Number,default:1},
|
|
11
|
+
tagid:{type:String,default:''},
|
|
12
|
+
returnfor:{type:Boolean,default:false},
|
|
13
|
+
done:{type:Boolean,default:false}
|
|
14
|
+
},{minimize:false}]
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
2
|
+
id: { type: String, default: '' },
|
|
3
|
+
custcode: { type: String, default: '' },
|
|
4
|
+
contactname: { type: String, default: '' },
|
|
5
|
+
contactphone: { type: String, default: '' },
|
|
6
|
+
contactemail: { type: String, default: '' },
|
|
7
|
+
customername: { type: String, default: '' },
|
|
8
|
+
descr: { type: String, default: '' },
|
|
9
|
+
dispatchnotes: { type: String, default: '' },
|
|
10
|
+
technotes: { type: String, default: '' },
|
|
11
|
+
street: { type: String, default: '' },
|
|
12
|
+
cityzip: { type: String, default: '' },
|
|
13
|
+
unit: { type: String, default: '' },
|
|
14
|
+
state: { type: String, default: '' },
|
|
15
|
+
takenby: { type: String, default: '' },
|
|
16
|
+
dept: { type: String, default: '' },
|
|
17
|
+
cat: { type: String, default: '' },
|
|
18
|
+
leadsource: { type: String, default: '' },
|
|
19
|
+
status: { type: String, default: '' },
|
|
20
|
+
jobref: { type: String, default: '' },
|
|
21
|
+
conref: { type: String, default: '' },
|
|
22
|
+
ref: { type: String, default: '' },
|
|
23
|
+
pricebook: { type: String, default: '' },
|
|
24
|
+
pricelevel: { type: String, default: 'STA' },
|
|
25
|
+
salesrep: { type: String, default: '' },
|
|
26
|
+
tech: { type: String, default: '' },
|
|
27
|
+
datecall: { type: Date, default: Date.now },
|
|
28
|
+
timecall: { type: String, default: '' },
|
|
29
|
+
dateorder: { type: Date, default: '' },
|
|
30
|
+
timeorder: { type: String, default: '' },
|
|
31
|
+
dateschedule: { type: Date, default: Date.now },
|
|
32
|
+
timeschedule: { type: String, default: '' },
|
|
33
|
+
datearrival: { type: Date, default: '' },
|
|
34
|
+
timearrival: { type: String, default: '' },
|
|
35
|
+
datecomplete: { type: Date, default: '' },
|
|
36
|
+
timecomplete: { type: String, default: '' },
|
|
37
|
+
datecompletesched: { type: Date, default: '' },
|
|
38
|
+
timecompletesched: { type: String, default: '' }
|
|
39
|
+
}
|
package/Service/service.js
CHANGED
|
@@ -8,5 +8,6 @@ module.exports = {
|
|
|
8
8
|
ChecklistForm:new Schema(...require('./schemas/checklistform.js')),
|
|
9
9
|
ChecklistField:new Schema(...require('./schemas/checklistfield.js')),
|
|
10
10
|
ChecklistCalc:new Schema(...require('./schemas/checklistcalc.js')),
|
|
11
|
-
Membership:new Schema(...require('./schemas/membership.js'))
|
|
11
|
+
Membership:new Schema(...require('./schemas/membership.js')),
|
|
12
|
+
Repair:new Schema(...require('./schemas/repairs.js'))
|
|
12
13
|
}
|