vhp-mongo-models 2.1.72 → 2.1.73

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.
@@ -1,17 +1,18 @@
1
1
  module.exports = [{
2
2
  id:{type:String,default:''}, //unique for THIS checklist
3
- coid:{type:String,default:''},
4
- hhid:{type:String,default:''},
5
- work:{type:String,default:""}, //just an array of work.id
6
- custcode:{type:String,default:''},
7
3
  name:{type:String,default:''}, //what checklist was used
8
4
  title:{type:String,default:''},
5
+ coid:{type:String,default:''},
6
+ hhid:{type:String,default:''},
7
+ work:{type:String,default:''}, //just an array of work.id
9
8
  sitems:{type:Array,default:[]}, //of service item ["ids"]
10
9
  scoring:{
11
10
  list:{type:Object,default:{}},
12
11
  score:{type:Object,default:{}},
13
12
  },
14
13
  fields:{type:Object,default:{}}, //to hold all of the checklist values
15
- notes:{type:Object,default:{}},
16
- 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
17
18
  },{minimize:false}]
@@ -7,8 +7,8 @@
7
7
  module.exports = [
8
8
  {
9
9
  phone: { type: String, default: '' }, // id
10
- type:{type:String,default:'owner'}, // owner | occupant
11
- roles:{type:Array,default:[]},// options AP | maintenance | reception | sales
10
+ type:{type:String,default:'occupant'}, // owner | occupant
11
+ roles:{type:Array,default:[]},// options resident | AP | maintenance | reception | sales
12
12
  custName:{type:String,default:''},
13
13
  clientfirst: { type: String, default: '' },
14
14
  clientlast: { type: String, default: '' },
@@ -19,7 +19,6 @@ module.exports = [
19
19
  lastInteraction: { type: String, default: '' },
20
20
  salesRep: { type: String, default: '' },
21
21
 
22
-
23
22
  //remove
24
23
  contactName:{type:String,default:''},
25
24
  lead:{type:String,default:''},
@@ -4,7 +4,7 @@
4
4
  */
5
5
  module.exports = [{
6
6
  hhid: { type: String, default: '' },
7
- type: {type:String,default:''},//COM | RES
7
+ type: {type:String, default: ''},//COM | RES
8
8
  street: { type: String, default: '' },
9
9
  unit: { type: String, default: '' },
10
10
  city: { type: String, default: '' },
@@ -13,7 +13,8 @@ module.exports = [{
13
13
 
14
14
  custid: { type: String, default: '' }, //phone number / billTo
15
15
  occupants: { type: Array, default: [] },
16
- jonascodes: {type:Array, default:[]}, //new add
16
+ jonascodes: {type:Array, default: []}, //new add
17
+ billto: {type:Boolean,default: false}, //if it is a billing address for other homes
17
18
  salesRep:{type:String,default:''},
18
19
 
19
20
  location: {
@@ -28,12 +29,8 @@ module.exports = [{
28
29
  }
29
30
  }
30
31
  },
31
- utilities: {
32
- type: Object, default: {
33
- eleccomp: '',
34
- gascomp: ''
35
- }
36
- },
32
+
33
+ utilities: {type:Array,default:[]},// gas | electric | water | etc
37
34
  measurements: { type: Object, default: {} },
38
35
  features: {
39
36
  elecService: {
@@ -70,21 +67,14 @@ module.exports = [{
70
67
  rooms: { type: Number, default: 0 }
71
68
  },
72
69
  spaces: { type: Array, default: [] },
73
-
74
- //remove
75
- billTo: { type: Boolean, default: false },
76
- froot: { type: String, default: '' }
77
70
  },
78
71
  { minimize: false }
79
72
  ]
80
73
  /**
81
- * jonascodes = [{coid:{type:String,default:''},custcode:{type:String,default:''}}]
74
+ * jonascodes = [{
75
+ * coid:{type:String,default:''},
76
+ * custcode:{type:String,default:''},
77
+ * billto:{type:String,default:''}
78
+ * }]
82
79
  *
83
- * contacts = [
84
- * {
85
- * role:{type:String,default:''},
86
- * phone:{type:String,default:''},
87
- * email:{type:String,default:''}
88
- * }
89
- * ]
90
80
  */
@@ -12,7 +12,7 @@ module.exports = [
12
12
  clientfirst:{type:String, default:''},
13
13
  clientlast:{type:String, default:''},
14
14
 
15
- status:{type:String,default:'CHILD'}, //PARENT | CHILD
15
+ status:{type:String,default:'PARENT'}, //PARENT | CHILD
16
16
  parent:{type:String,default:''},
17
17
  children:{type:Array,default:[]},
18
18
 
@@ -3,10 +3,7 @@ module.exports = [
3
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
- system:{type:String,default:''}, //way to link related service items
7
- space:{type:String,default:''},
8
6
  considerreplace:{type:Date,default:''},
9
- subspace:{type:String,default:''},
10
7
  quantity:{type:Number,default:1}, //optional qty
11
8
  notes:{type:Array,default:[]},// for better history {tech:'',date:'',ticketId:''}
12
9
  edits:{type:Object,defualt:{}}, //to track all of the fields that have been changed since sync
@@ -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:''},//remove, same as space / sub space
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,11 @@ module.exports = [
46
43
  filt2q:{type:String,default:'0'},
47
44
  filt3:{type:String,default:''},
48
45
  filt3q:{type:String,default:''}
46
+
47
+
48
+ // system:{type:String,default:''}, //way to link related service items
49
+ // space:{type:String,default:''},
50
+ // subspace:{type:String,default:''},
49
51
  },
50
52
  {minimize:false}
51
53
  ]
@@ -59,11 +59,7 @@ module.exports = [
59
59
  name: { type: String, default: '' },
60
60
  coid: { type: String, default: '' },
61
61
  jobnum: { type: String, default: '' },
62
- ref: { type: String, default: '' },
63
62
  hhid: { type: String, default: '' },
64
- clientfirst: { type: String, default: '' },
65
- clientlast: { type: String, default: '' },
66
- ...aaddress,
67
63
  ...acontact,
68
64
  estimator: { type: String, default: 'unassigned' },
69
65
  schedule: { type: Array, default: [] },
@@ -77,8 +73,12 @@ module.exports = [
77
73
  info: info,
78
74
  contracts: { type: Array, default: [] },
79
75
  lead: lead,
80
- refs: { type: Array, default: [] },
81
- froot: { type: String, default: '' }
76
+ refs: { type: Array, default: [] }, //do we need?
77
+ froot: { type: String, default: '' },
78
+ //joblog to be added to flat
79
+
80
+ ...aaddress, //remove
81
+ // ref: { type: String, default: '' },
82
82
  },
83
83
  {
84
84
  toJSON: { virtuals: true },
@@ -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
- //group:{type:String,default:''},
34
- //subgroup:{type:String,default:''},
35
- //category:{type:String,default:''},
36
- //rules:{type:Object,default:{}}
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,22 +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
- color:{type:String,default:''},
6
- groups:{type:Array,default:[]},
9
+
7
10
  included:{type:Array,default:[]},
8
- done:{type:Boolean,default:false},
9
- autoadd:{type:Boolean,default:false},
10
- category:{type:String,default:""},
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
- types:{type:Array,default:[]},
15
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
16
20
  present:{type:Boolean,default:true},
17
- building:{type:String,default:''}, //RES | COM
18
-
19
- //sitemTags:{type:Array,default:[]},
20
- rewards:{type:Boolean,default:false},
21
- signature:{type:Boolean,default:false},
21
+ signature:{type:Boolean,default:false} //if a signature is required to complete
22
22
  },{minimize:false}]
@@ -15,7 +15,7 @@ let repairEstimate = {
15
15
  }
16
16
 
17
17
  let ticketTime = {
18
- techs:{type:Object,default:{}},
18
+ techs:{type:Number,default:0},
19
19
  driving:{type:Number,default:0},
20
20
  labor:{type:Number,default:0},
21
21
  start:{type:Date,default:''},
@@ -40,15 +40,15 @@ let ticketFinal = {
40
40
  returnNotes:{type:String,default:''},
41
41
  repairEstimate:repairEstimate, //was ticketTime
42
42
  ticketTime:ticketTime,
43
- officeSubmit:{type:String,default:''},
44
43
  completedBy:{type:String,default:''}, //was type=Array
45
44
  afterHours:{type:Boolean,default:false},
46
45
 
47
46
 
48
47
  showReplacement:{type:Boolean,default:false}, //may not need
49
48
  serviceReferral:{type:Boolean,default:false}, //may not need
50
-
51
-
49
+
50
+
51
+ // officeSubmit:{type:String,default:''},
52
52
  //addlDetails:{type:String,default:''},
53
53
  //timelog:{type:Object,default:{}},
54
54
  //paymentMethod:{type:String,default:''},
@@ -57,10 +57,12 @@ const ticketFinal = require('./final.js')
57
57
  */
58
58
  module.exports = {
59
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
60
64
  ref: { type: Object, default: {} },
61
65
  custid: {type:String, default:''},
62
- coid:{type:String,default:''},
63
- wonum:{type:String,default:''}, //the wonum from jonas. relative to the the company
64
66
  cat:{type:String,default:''}, //converted cat from jonas. Orginal cat can be found in wo.cat
65
67
  dept:{type:String,default:''},
66
68
 
@@ -70,21 +72,18 @@ module.exports = {
70
72
 
71
73
  salesrep:{type:String,default:''},
72
74
 
73
- hhid:{type:String,default:''},
74
- ...aaddress, //do not need?
75
-
75
+ sitems: { type: Array, default: [] },
76
76
  checks: { type: Object, default: {} },
77
77
  repairs: { type: Object, default: {} },
78
- sitems: { type: Array, default: [] },
79
-
80
- todo: {type:Object,default:{}},//used for all todos in workflow.
81
- //remove the following and merge into 'todo' with a type
82
- office: { type: Object, default: {} },//any todo items for the office
83
- field: {type:Object,default:{}},//any todo items for the field
84
-
78
+
79
+ todo: {type:Object,default:{}},//was office
85
80
  final: ticketFinal,
86
- contract: { type: Object, default: {} }, // the contract attached to the client. Should move off of WO into separate query
87
-
81
+
88
82
  wo: wo,
89
- 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
90
89
  }
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:''}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vhp-mongo-models",
3
- "version": "2.1.72",
3
+ "version": "2.1.73",
4
4
  "productName": "VHP Mongo Models",
5
5
  "description": "Mongo Models library to setup Mongoose Schemas",
6
6
  "author": "VHPim",