vhp-mongo-models 2.0.0 → 2.0.1

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.
@@ -4,5 +4,6 @@ module.exports = {
4
4
  Client:new Schema(...require('./schemas/client.js')),
5
5
  Home:new Schema(...require('./schemas/home.js')),
6
6
  ServiceItem:new Schema(...require('./schemas/serviceitem.js')),
7
- SIupdate:new Schema(...require('./schemas/siupdate.js'))
7
+ SIupdate:new Schema(...require('./schemas/siupdate.js')),
8
+ Checklist:new Schema(...require('./schemas/checklist.js'))
8
9
  }
@@ -0,0 +1,13 @@
1
+ module.exports = [{
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
+ name:{type:String,default:''}, //what checklist was used
7
+ sitems:{type:Array,default:[]}, //of service item ["ids"]
8
+ scoring:{
9
+ list:{type:Object,default:{}},
10
+ score:{type:Object,default:{}},
11
+ },
12
+ fields:{type:Object,default:{}} //to hold all of the checklist values
13
+ },{minimize:false}]
@@ -0,0 +1,8 @@
1
+ module.exports = [{
2
+ id:{type:String,default:''}, //what checklist was used
3
+ name:{type:String,default:''}, //optional name for THIS checklist
4
+ work:{type:Array,default:[]},
5
+ hhid:{type:String,default:''},
6
+ sitems:{type:Array,default:[]},//of service item ids
7
+ checks:{type:Object,default:{}} //to hold all of the checklist values
8
+ }]
@@ -79,5 +79,6 @@ module.exports = [
79
79
  },
80
80
  spaces:{type:Array,default:[]},
81
81
  froot:{type:String,default:''}
82
- }
82
+ },
83
+ {minimize:false}
83
84
  ]
@@ -1,9 +1,9 @@
1
-
2
1
  module.exports = [
3
2
  {
3
+ //VHP ADD fields
4
4
  hhid:{type:String,default:''}, //must have a hhid
5
5
  group:{type:String,default:''},//names the type of product it is. Would like to use this instead of type
6
- sysid:{type:String,default:''}, //way to link related service items
6
+ system:{type:String,default:''}, //way to link related service items
7
7
  space:{type:String,default:''},
8
8
  subspace:{type:String,default:''},
9
9
  quantity:{type:Number,default:1}, //optional qty
@@ -23,13 +23,12 @@ module.exports = [
23
23
  serial:{type:String,default:''},
24
24
  manf:{type:String,default:''},
25
25
 
26
- location:{type:String,default:''},
27
- area:{type:String,default:''},
26
+ location:{type:String,default:''},//remove, same as space / sub space
27
+ area:{type:String,default:''},//remove, same as space / sub space
28
28
 
29
29
  controls:{type:String,default:''},
30
30
  elec:{type:String,default:''},
31
31
 
32
-
33
32
  warr1:{type:Number,default:0},
34
33
  warr2:{type:Number,default:0},
35
34
  warr3:{type:Number,default:0},
@@ -45,5 +44,6 @@ module.exports = [
45
44
  filt2q:{type:String,default:'0'},
46
45
  filt3:{type:String,default:''},
47
46
  filt3q:{type:String,default:''}
48
- }
47
+ },
48
+ {minimize:false}
49
49
  ]
@@ -0,0 +1,71 @@
1
+
2
+
3
+ /*
4
+ constracts = [{
5
+ contractid: contractid,
6
+ jobnum: project.jobnum || '',
7
+ jobname: project.name || '',
8
+ solname: solution.name || '',
9
+ name: solution.name || '',
10
+ version: false,
11
+ strtdate: null,
12
+ solddate: null,
13
+ sold: sold,
14
+ estimator: project.estimator || '',
15
+ dept: project.dept,
16
+ type: solution.type || '', // not editable; helps determine which templates to use [string]
17
+ path: path,
18
+ hhid: project.hhid || '', // not editable; not shown anywhere
19
+ custcode: project.custid || '', // not editable
20
+ projectid: project.id || '',
21
+ customer: { // all editable (besides longCity and fullName) [strings]
22
+ clientFirst: project.clientfirst,
23
+ clientLast: project.clientlast,
24
+ name: `${project.clientfirst} ${project.clientlast}` || project.clientfirst || project.clientlast,
25
+ street: project.street,
26
+ unit: project.unit,
27
+ city: project.city,
28
+ state: project.state,
29
+ zip: project.zip,
30
+ longCity: project.city + ', ' + project.state + ' ' + project.zip,
31
+ phone: project.phone,
32
+ email: project.email
33
+ },
34
+ general:{
35
+ net:0,
36
+ projid:'',
37
+ contractid:'',
38
+ dept:''
39
+ },
40
+ subs:[], //list
41
+ finance: {
42
+ billto: '', // editable (searchable?) [string]
43
+
44
+ net: 0, // editable [price]
45
+
46
+ downAmount: 0, // editable [price]
47
+ downDate: '', // editable [date]
48
+ downVia: '', // editable ( check number | card last 4 | cash ) [string]
49
+
50
+ financed: financed,
51
+ fincode: '', // editable [string]
52
+ finAmount: 0, // editable [price]
53
+ finTerm: 0, // referenced from fintable via finCode string [number]
54
+ finAPR: '', // referenced from fintable via finCode string [string]
55
+
56
+ dueComplete: 0 // calculation (net - downAmount- dueComplete) [price]
57
+ },
58
+ discounts: [],
59
+ additions: [],
60
+ notes: '',
61
+ terms: { // not editable; not shown on editor or preview, shown on print; gathered from table in settings [string]
62
+ financing: '',
63
+ collections: ''
64
+ },
65
+ solution: { // editablilty will depend on solution. will be blank if STANDARD contract
66
+ //windows:[]
67
+ //envelope:[]
68
+ //vhc:[]
69
+ }
70
+ }]
71
+ */
@@ -42,12 +42,23 @@ let lead = {
42
42
  }
43
43
  let info = {
44
44
  pkids:{type:Array,default:[]},
45
- spaces:{type:Object,default:[]},
45
+ spaces:{type:Array,default:[]},
46
46
  summary:{type:Object,default:{}},
47
47
  quotes:{type:Object,default:{}},
48
48
  joblog:{type:Object,default:{}},
49
49
  pvmaint:pvmaint,
50
50
  }
51
+ /*
52
+ info.spaces = [{
53
+ * id:{type:String,default:''},
54
+ * title:{type:String,default:''}
55
+ * subspaces:{type:String,default:[{
56
+ * id:{type:String,default:''},
57
+ * title:{type:String,default:''}
58
+ * }]}
59
+ * }]]
60
+ */
61
+
51
62
  /** Projects Schema
52
63
  *
53
64
  * index
@@ -86,73 +97,3 @@ module.exports=[
86
97
  minimize:false
87
98
  }
88
99
  ]
89
-
90
- /*
91
- constracts = [{
92
- contractid: contractid,
93
- jobnum: project.jobnum || '',
94
- jobname: project.name || '',
95
- solname: solution.name || '',
96
- name: solution.name || '',
97
- version: false,
98
- strtdate: null,
99
- solddate: null,
100
- sold: sold,
101
- estimator: project.estimator || '',
102
- dept: project.dept,
103
- type: solution.type || '', // not editable; helps determine which templates to use [string]
104
- path: path,
105
- hhid: project.hhid || '', // not editable; not shown anywhere
106
- custcode: project.custid || '', // not editable
107
- projectid: project.id || '',
108
- customer: { // all editable (besides longCity and fullName) [strings]
109
- clientFirst: project.clientfirst,
110
- clientLast: project.clientlast,
111
- name: `${project.clientfirst} ${project.clientlast}` || project.clientfirst || project.clientlast,
112
- street: project.street,
113
- unit: project.unit,
114
- city: project.city,
115
- state: project.state,
116
- zip: project.zip,
117
- longCity: project.city + ', ' + project.state + ' ' + project.zip,
118
- phone: project.phone,
119
- email: project.email
120
- },
121
- general:{
122
- net:0,
123
- projid:'',
124
- contractid:'',
125
- dept:''
126
- },
127
- subs:[], //list
128
- finance: {
129
- billto: '', // editable (searchable?) [string]
130
-
131
- net: 0, // editable [price]
132
-
133
- downAmount: 0, // editable [price]
134
- downDate: '', // editable [date]
135
- downVia: '', // editable ( check number | card last 4 | cash ) [string]
136
-
137
- financed: financed,
138
- fincode: '', // editable [string]
139
- finAmount: 0, // editable [price]
140
- finTerm: 0, // referenced from fintable via finCode string [number]
141
- finAPR: '', // referenced from fintable via finCode string [string]
142
-
143
- dueComplete: 0 // calculation (net - downAmount- dueComplete) [price]
144
- },
145
- discounts: [],
146
- additions: [],
147
- notes: '',
148
- terms: { // not editable; not shown on editor or preview, shown on print; gathered from table in settings [string]
149
- financing: '',
150
- collections: ''
151
- },
152
- solution: { // editablilty will depend on solution. will be blank if STANDARD contract
153
- //windows:[]
154
- //envelope:[]
155
- //vhc:[]
156
- }
157
- }]
158
- */
@@ -0,0 +1,38 @@
1
+ /*
2
+ Quotes are currently held in project.info.quotes={
3
+ <quoteType>:{
4
+ coid:string
5
+ type:string
6
+ solutions:array
7
+ }
8
+ }
9
+
10
+ const aquote = {
11
+ coid: 'string',
12
+ type: 'string',
13
+ solutions: []
14
+ }
15
+
16
+ const asolution = {
17
+ name: 'string',
18
+ tiers: [],
19
+ space: 'string',
20
+ subspace: 'string',
21
+ details: 'object', // ie 'access point', 'heat load'
22
+ strategy: 'string',
23
+ additions: [],
24
+ discounts: [],
25
+ summary: { // main access point to 'get' information on the quote
26
+ tiers: [], // calculated totals for each option (base + additions + discounts + etc)
27
+ path: [], // 'path' to the selected option
28
+ contractid: 'string',
29
+ finance: {}
30
+ }
31
+ }
32
+
33
+ const atier= {
34
+ name: '',
35
+ {productInfo}
36
+ }
37
+
38
+ */
@@ -0,0 +1,40 @@
1
+
2
+ /*
3
+ input = { /GOOD
4
+ inputType:{type:String,default:''},
5
+ type:{type:String,default:''},
6
+ options:{type:Object,default:{}}
7
+ }
8
+
9
+ scoring = { /Good
10
+ cat:{type:Object,default:{}},
11
+ total:{type:Number,default:0},
12
+ type:{type:String,default:''},
13
+ points:{type:Array,default:[]}
14
+ }
15
+
16
+ calc = { /Good
17
+ id:{type:Array,default:[]},
18
+ depends:{type:Array,default:[]}
19
+ }
20
+
21
+
22
+ */
23
+ module.export=[{
24
+ id:{type:String,default:''},
25
+ title:{type:String,default:''},
26
+ desc:{type:String,default:''},
27
+ building:{type:String,default:''}, // COM | RES
28
+ input:{type:Object,default:{}},
29
+ //class:{type:String,default:''}, //remove is now id
30
+ group:{type:String,default:''},
31
+ subgroup:{type:String,default:''},
32
+ category:{type:String,default:''},
33
+ scoring:{type:Object,default:{}},
34
+ type:{type:Object,default:{}},
35
+ notes:{type:Object,default:{}},
36
+ required:{type:Boolean,default:true},
37
+ rewards:{type:Boolean,default:false},
38
+ present:{type:Boolean,default:true},
39
+ calc:{type:Object,default:{}}
40
+ },{minimize:false}]
@@ -0,0 +1,14 @@
1
+ module.exports = [{
2
+ name:{type:String,default:''},
3
+ title:{type:String,default:''},
4
+ desc:{type:String,default:''},
5
+ sitemTags:{type:Array,default:[]},
6
+ included:{type:Array,default:[]},
7
+ categories:{type:Array,default:[]},
8
+ grades:{type:Array,default:[]},
9
+ scored:{type:Boolean,default:false},
10
+ color:{type:String,default:''},
11
+ rewards:{type:Boolean,default:false},
12
+ enabled:{type:Boolean,default:true},
13
+ present:{type:Boolean,default:true}
14
+ }]
@@ -8,7 +8,8 @@ let ticketInvoice = {
8
8
  let repairEstimate = {
9
9
  time:{type:Number,default:0}, //time to complete all repairs
10
10
  revenuePerEstimate:{type:Number,default:0},
11
- revenuePer:{type:Number,default:0}
11
+ revenuePer:{type:Number,default:0},
12
+ techCount:{type:Number,default:0}
12
13
  }
13
14
 
14
15
  let ticketFinal = {
@@ -51,7 +52,8 @@ module.exports = ticketFinal
51
52
  }
52
53
  pricing:{
53
54
  <pl1>:{type:Number,default:0},
54
- <pl2>:{type:Number,default:0}
55
+ <pl2>:{type:Number,default:0},
56
+ ...
55
57
  }
56
58
  }]
57
59
  }
@@ -6,17 +6,29 @@ const ticketFinal = require('./final.js')
6
6
  [
7
7
  <user>:{
8
8
  name:{type:String,default:''},
9
- assigned:{type:Array,default:[{
10
- id:{type:String,default:''}, //the service item id
11
- name:{type:String,default:''},
12
- type:{type:String,default:''}, //describes the
13
- done:{type:String,default:false} //WORKING | READY | COMPLETE
9
+ assigned:{
10
+ <sitem.id>:{
11
+ id:{type:String,default:''}, //the service item id
12
+ name:{type:String,default:''},
13
+ type:{type:String,default:''}, //describes the
14
+ done:{type:String,default:false} //WORKING | READY | COMPLETE
15
+ work:{type:Array,default:[{
16
+ id:{type:String,default:''}, //the service item id
17
+ name:{type:String,default:''},
18
+ type:{type:String,default:''}, //describes the
19
+ done:{type:String,default:false} //WORKING | READY | COMPLETE
20
+ }]}
21
+ }
14
22
  }]},
15
23
  driveTime:{type:Date,default:''},
16
24
  startTime:{type:Date,default:''},
17
25
  endTime:{type:Date,default:''},
18
26
  adjustTime:{type:Number,default:0},
19
27
  totalTime:{type:Number,default:0}
28
+ revenue:{
29
+ perHour:{type:Number,default:0}, //techs revenue per hour based on their repairs
30
+ contribution:{type:Number,default:0} //the portion of revenue the tech worked on
31
+ }
20
32
  }
21
33
  ]
22
34
  */
@@ -28,7 +40,6 @@ const ticketFinal = require('./final.js')
28
40
  needReplace:{type:Boolean:default:false}
29
41
  }]
30
42
  */
31
-
32
43
  module.exports = {
33
44
  id: { type: String, default: '' },
34
45
  ref: { type: Object, default: {} },
@@ -4,5 +4,7 @@ module.exports = {
4
4
  ActiveTicket:new Schema(...require('./schemas/activeticket.js')),
5
5
  CompleteTicket:new Schema(...require('./schemas/completeticket.js')),
6
6
  Spiff:new Schema(...require('./schemas/spiff.js')),
7
- SpiffReport:new Schema(...require('./schemas/spiffreport.js'))
7
+ SpiffReport:new Schema(...require('./schemas/spiffreport.js')),
8
+ ChecklistForm:new Schema(...require('./schemas/checklistform.js')),
9
+ ChecklistField:new Schema(...require('./schemas/checklistfield.js'))
8
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vhp-mongo-models",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "productName": "VHP Mongo Models",
5
5
  "description": "Mongo Models library to setup Mongoose Schemas",
6
6
  "author": "VHPim",