vhp-mongo-models 2.1.96 → 2.1.98

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.
@@ -6,28 +6,25 @@
6
6
  */
7
7
 
8
8
  module.exports = [{
9
- id: { type: String, default: '' },
10
- board: { type: String, default: '' },
9
+ id: { type: String, default: Date.now },
11
10
  coid: { type: String, default: '' }, //required
12
11
  dept: { type: String, default: '' }, //would like to require
13
- hhid: { type: String, default: '' }, //
12
+ hhid: { type: String, default: 'HSE' },
13
+ custid: { type: String, default: '' },
14
14
 
15
+ board: { type: String, default: '' },
15
16
  type: { type: String, default: '' }, // 'follow-up' | 'consultation' | 'install' | 'meeting' | 'special
16
- title: { type: String, default: '' },
17
- descriptions: {type:String, default:''},
18
- status: { type: String, default: '' }, //un-scheduled | scheduled | pastdue | inprogress | complete
19
-
20
- dates: { type: Array, default: [] }, // array of date objects. dates[0]=start dates[...]=other dates
21
-
22
- lead: { type: String, default: '' }, //to tie to the lead
23
- workref: { type: String, default: '' }, // refrence to work can only be tied to one piece of work
24
- worktype: { type: String, default: '' }, // the type of work refrenced
17
+ tags: { type: Array, default: [] },
25
18
 
19
+ title: { type: String, default: '' },
20
+ desc: { type: String, default: '' },
26
21
  attendees: { type: Array, default: [] }, // array of user names
27
- attachments: { type: Array, default: [] }, // array of 'attachment's
28
- notes: { type: String, default: '' },
29
-
30
- //
31
- ref: { type: String, default: '' }, //was the connection to projects - can be moved to workRef
32
- wonum: { type: String, default: '' }//do not need -> was the refrerence the wo
22
+
23
+ next: { type: Number, default: 0 },//any dates index < activedate are considered closed
24
+ dates: { type: Array, default: [] }, // ISOstring?
25
+
26
+ lead: { type: String, default: '' }, //to tie to the lead
27
+ ticket: { type: String, defatul: '' },
28
+ project: { type: String, default: '' },
29
+ refs: { type: Array, default: [] },
33
30
  }]
@@ -1,6 +1,7 @@
1
1
  module.exports = [
2
2
  {
3
3
  name: { type: String, default: '' }, //unique
4
+ altName:{type:String,default:''},
4
5
  notes: { type: String, default: '' },
5
6
  level: { type: String, default: 'tier' }, // tier | solution | project
6
7
  type: { type: String, default: 'instant' }, // instant | postpurchase | credit | silent
@@ -1,89 +1,91 @@
1
- const {aaddress}=require('../../../core-models.js');
1
+ const { aaddress } = require('../../../core-models.js');
2
2
  const wo = require('./jonaswo.js')
3
3
  const ticketFinal = require('./final.js')
4
4
 
5
5
  /* TECHINFO *
6
6
  [
7
- <user>:{
8
- name:{type:String,default:''},
9
- coid:{type:String,default:''},
10
- assigned:{
11
- <sitem.id>:{
12
- id:{type:String,default:''}, //the service item id
13
- name:{type:String,default:''},
14
- type:{type:String,default:''}, //describes the
15
- done:{type:String,default:false} //WORKING | READY | COMPLETE
16
- work:{type:Array,default:[{
17
- id:{type:String,default:''}, //the service item id
18
- name:{type:String,default:''},
19
- type:{type:String,default:''}, //describes the
20
- done:{type:String,default:false} //WORKING | READY | COMPLETE
21
- }]}
22
- }
23
- }]},
7
+ <user>:{
8
+ name:{type:String,default:''},
9
+ coid:{type:String,default:''},
10
+ assigned:{
11
+ <sitem.id>:{
12
+ id:{type:String,default:''}, //the service item id
13
+ name:{type:String,default:''},
14
+ type:{type:String,default:''}, //describes the
15
+ done:{type:String,default:false} //WORKING | READY | COMPLETE
16
+ work:{type:Array,default:[{
17
+ id:{type:String,default:''}, //the service item id
18
+ name:{type:String,default:''},
19
+ type:{type:String,default:''}, //describes the
20
+ done:{type:String,default:false} //WORKING | READY | COMPLETE
21
+ }]}
22
+ }
23
+ }]},
24
24
 
25
- //for activetickets
26
- driveTime:{type:Date,default:''},
27
- startTime:{type:Date,default:''},
28
- endTime:{type:Date,default:''},
29
- adjustTime:{type:Number,default:0},
25
+ //for activetickets
26
+ driveTime:{type:Date,default:''},
27
+ startTime:{type:Date,default:''},
28
+ endTime:{type:Date,default:''},
29
+ adjustTime:{type:Number,default:0},
30
30
 
31
- //for completetickets
32
- totalDrive:{type:Number,default:0},
33
- totalTime:{type:Number,default:0},
31
+ //for completetickets
32
+ totalDrive:{type:Number,default:0},
33
+ totalTime:{type:Number,default:0},
34
34
 
35
- complete:{type:Boolean,default:false},
36
- revenue:{
37
- perHour:{type:Number,default:0}, //techs revenue per hour based on their repairs
38
- contribution:{type:Number,default:0} //the portion of revenue the tech worked on
39
- }
40
- }
35
+ complete:{type:Boolean,default:false},
36
+ revenue:{
37
+ perHour:{type:Number,default:0}, //techs revenue per hour based on their repairs
38
+ contribution:{type:Number,default:0} //the portion of revenue the tech worked on
39
+ }
40
+ }
41
41
  ]
42
42
  */
43
43
 
44
44
 
45
45
  /*
46
- repairs = {
47
- <sitem.id>:[{
48
- task:{type:String,default:''},
49
- desc:{type:String,default:''},
50
- ...other flatrate fields,
51
- appr:{type:String,default:'PENDING'}, // 'YES' | 'NO'
52
- done:{type:Boolean,default:false},
53
- note:{type:String,default:''}
54
- returnfor:{type:Boolean,default:false}
55
- }]
56
- }
46
+ repairs = {
47
+ <sitem.id>:[{
48
+ task:{type:String,default:''},
49
+ desc:{type:String,default:''},
50
+ ...other flatrate fields,
51
+ appr:{type:String,default:'PENDING'}, // 'YES' | 'NO'
52
+ done:{type:Boolean,default:false},
53
+ note:{type:String,default:''}
54
+ returnfor:{type:Boolean,default:false}
55
+ }]
56
+ }
57
57
  */
58
58
  module.exports = {
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
64
- ref: { type: Object, default: {} },
65
- custid: {type:String, default:''},
66
- cat:{type:String,default:''}, //converted cat from jonas. Orginal cat can be found in wo.cat
67
- dept:{type:String,default:''},
68
- temp:{type:Boolean,default:false},
69
- techs: { type: Array, default: [] },
70
- techinfo: {type:Object, default:{}}, //hold all info on techs involved
71
- timelog: {type:Array, default:[]},
59
+ id: { type: String, default: '' }, // <coid><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
64
+ ref: { type: Object, default: {} },
65
+ custid: { type: String, default: '' },
66
+ cat: { type: String, default: '' }, //converted cat from jonas. Orginal cat can be found in wo.cat
67
+ dept: { type: String, default: '' },
68
+ temp: { type: Boolean, default: false },
69
+ techs: { type: Array, default: [] },
70
+ techinfo: { type: Object, default: {} }, //hold all info on techs involved
71
+ timelog: { type: Array, default: [] },
72
+ hold: { type: Boolean, default: false },
73
+ scheduledate: { type: Date, default: '' },
72
74
 
73
- salesrep:{type:String,default:''},
74
-
75
- sitems: { type: Array, default: [] },
76
- checks: { type: Object, default: {} },
77
- repairs: { type: Object, default: {} },
78
-
79
- todo: {type:Object,default:{}},//was office
80
- final: ticketFinal,
81
-
82
- wo: wo,
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
89
- }
75
+ salesrep: { type: String, default: '' },
76
+
77
+ sitems: { type: Array, default: [] },
78
+ checks: { type: Object, default: {} },
79
+ repairs: { type: Object, default: {} },
80
+
81
+ todo: { type: Object, default: {} },//was office
82
+ final: ticketFinal,
83
+
84
+ wo: wo,
85
+ logs: { type: Array, default: [] }, //match with project datelog. Would like it to stay as "logs" though
86
+
87
+ //Remove
88
+ // contract: { type: Object, default: {} }, // the contract attached to the client. Should move off of WO into separate query
89
+ // office: { type: Object, default: {} },//any todo items for the office
90
+ // field: {type:Object,default:{}},//any todo items for the field
91
+ }
@@ -5,36 +5,38 @@ const userSetup = require('./subs/userAppSettings.js')
5
5
  * the settings can be changed, but reset to the type at any time.
6
6
  * Apps will be the available menu for the portal, where permissions and admin would describe access with the menu views.
7
7
  */
8
- module.exports=[
9
- {
10
- empID:{type:String,default:''},
11
- user:{type:String,defaullt:''},
12
- admin:{type:Boolean,default:false},
13
- profile:{type:String,default:''},//optional to connect to a UserProfile
8
+ module.exports = [
9
+ {
10
+ empID: { type: String, default: '' },
11
+ user: { type: String, defaullt: '' },
12
+ admin: { type: Boolean, default: false },
13
+ profile: { type: String, default: '' },//optional to connect to a UserProfile
14
14
 
15
- ...userSetup, //holds all lists and switchs. can be overwritten by profile
16
-
17
- types:{type:Array,default:[]}, //'TECH', 'CONSULTANT', 'CSR', 'DISPATCH', '
18
- preferences:{type:Object,default:{//to hold items "tweakable" from the portal
19
- system:{
20
- darkMode:false,
21
- defaultApp:'',
22
- defaultView:''
23
- },
24
- company:{
25
- companies:[],
26
- departments:[]
27
- },
28
- home:{
29
- type:[],//COM | RES
30
- favorites:[],
31
- links:[],
32
- carousel:[]
33
- }
34
- }}
35
- },
36
- {
37
- //toJSON: { virtuals: true },
38
- //toObject: { virtuals: true }
39
- }
15
+ ...userSetup, //holds all lists and switchs. can be overwritten by profile
16
+
17
+ types: { type: Array, default: [] }, //'INSTALL', 'CONSULTANT', 'CSR', 'DISPATCH', '
18
+ preferences: {
19
+ type: Object, default: {//to hold items "tweakable" from the portal
20
+ system: {
21
+ darkMode: false,
22
+ defaultApp: '',
23
+ defaultView: ''
24
+ },
25
+ company: {
26
+ companies: [],
27
+ departments: []
28
+ },
29
+ home: {
30
+ type: [],//COM | RES
31
+ favorites: [],
32
+ links: [],
33
+ carousel: []
34
+ }
35
+ }
36
+ }
37
+ },
38
+ {
39
+ //toJSON: { virtuals: true },
40
+ //toObject: { virtuals: true }
41
+ }
40
42
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vhp-mongo-models",
3
- "version": "2.1.96",
3
+ "version": "2.1.98",
4
4
  "productName": "VHP Mongo Models",
5
5
  "description": "Mongo Models library to setup Mongoose Schemas",
6
6
  "author": "VHPim",