vhp-mongo-models 1.6.0 → 1.6.2

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.
@@ -5,5 +5,6 @@ module.exports={
5
5
  PricingBEE:new Schema(...require('./schemas/pricingbee.js')),
6
6
  Pricing300:new Schema(...require('./schemas/pricing300.js')),
7
7
  Addition:new Schema(...require('./schemas/additions.js')),
8
- Finance:new Schema(...require('./schemas/financing.js'))
8
+ Finance:new Schema(...require('./schemas/financing.js')),
9
+ Discount:new Schema(...require('./schemas/discounts.js'))
9
10
  }
@@ -2,15 +2,24 @@ module.exports=[
2
2
  {
3
3
  name:{type:String,default:''}, // pricebook / collection name
4
4
  notes:{type:String,default:''}, // versioned | table
5
- cat:{type:String,default:''}, // pkid | update date?
6
- type:{type:String,default:''},
5
+ type:{type:String,default:''}, // the quote type ex. hvac | envelope | window
6
+ cat:{type:String,default:''}, // department provided groupings
7
7
  mfg:{type:String,default:''},
8
8
  model:{type:String,default:''},
9
- settings:{type:String,default:''},
10
- location:{type:Array,default:[]},
11
9
  labor:{type:Number,default:0},
12
10
  laborpart:{type:Number,default:0},
13
- price:{type:Number,default:0},
14
- pricededuct:{type:Number,default:0}
11
+ settings:{type:Object,default:{}},
12
+ pricededuct:{type:Number,default:0}, //price to take off
13
+ pricesale:{type:Number,default:0},
14
+ userCreated:{type:Boolean,default:false}, //may not need, is really for gui
15
+ tiers:{type:Array,default:[]} //may not need, is really for gui
15
16
  }
16
17
  ]
18
+
19
+ /*
20
+ settings = {
21
+
22
+ location:{type:Array,default:[]},
23
+ swap:{type:Array,default:[]}
24
+ }
25
+ */
@@ -0,0 +1,14 @@
1
+
2
+ module.exports=[
3
+ {
4
+ name:{type:String,default:''}, //unique
5
+ type:{type:String,default:'instant'}, // instant | postpurchase | credit
6
+ unit:{type:String,default:'dollar'}, // dollar | percent
7
+ level:{type:String,default:'tier'}, // tier | solution | project
8
+ amount:{type:Number,default:0},
9
+ source:{type:String,default:''}, //needs further explaining to id the purpose
10
+ notes:{type:String,default:''},
11
+ userCreated:{type:Boolean,default:false}, //may not need, is really for gui
12
+ tiers:{type:Array,default:[]} //may not need, is really for gui
13
+ }
14
+ ]
@@ -10,7 +10,11 @@ const { aaddress, acontact } = require('../../core-models.js');
10
10
  * photos:{type:Boolean},
11
11
  * scheduled:{type:Boolean}
12
12
  * }]
13
- */
13
+ */
14
+
15
+ /**
16
+ *
17
+ */
14
18
  let pvmaint = new Schema({
15
19
  contractNum:{type:String,default:''},
16
20
  rewardNum:{type:String,default:''},
@@ -82,3 +86,73 @@ module.exports=[
82
86
  toObject: { virtuals: true }
83
87
  }
84
88
  ]
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
+ */
@@ -6,6 +6,7 @@ module.exports = [
6
6
  ...aticket,
7
7
  status: { type: String, default: 'active' },
8
8
  documents: { type: Array, default: [] },
9
- approval:{type:String,default:'NOT'}, // NOT | SENT | APPROVED
10
- }
9
+ approval:{type:String,default:'WORKING'}, // WORKING | SENT | APPROVED
10
+ approvalCode:{type:String,default:''}
11
+ },{minimize:false}
11
12
  ]
@@ -26,7 +26,34 @@ let ticketFinal = new Schema({
26
26
  repairEstimate:repairEstimate, //was ticketTime
27
27
  timelog:{type:Object,default:{}},
28
28
  officeSubmit:{type:String,default:''},
29
- completedBy:{type:Array,default:[]} //change to string, and tag with the lead who completed
29
+ completedBy:{type:Array,default:[]} //change to string, lcoaland tag with the lead who completed
30
30
  })
31
31
 
32
- module.exports = ticketFinal
32
+ module.exports = ticketFinal
33
+
34
+ /*
35
+ summary = {
36
+ approved:{
37
+ name:{type:String,default:''},
38
+ signature:{type:String,default:''}
39
+ }
40
+ total:{
41
+ mprice:{type:Number,default:0},
42
+ rprice:{type:Number,default:0},
43
+ msavings:{type:Number,default:0},
44
+ rsavings:{type:Number,default:0}
45
+ }
46
+ repairs:{
47
+ <sitem.id>:[{
48
+ repair:{
49
+ task:{type:String,default:''}
50
+ appr:{type:String,default:''} // YES | NO | RETURNFOR
51
+ }
52
+ pricing:{
53
+ <pl1>:{type:Number,default:0},
54
+ <pl2>:{type:Number,default:0}
55
+ }
56
+ }]
57
+ }
58
+ }
59
+ */
@@ -8,7 +8,9 @@ const ticketFinal = require('./final.js')
8
8
  name:{type:String,default:''},
9
9
  assigned:{type:Array,default:[{
10
10
  id:{type:String,default:''}, //the service item id
11
- done:{type:Boolean,default:false}
11
+ name:{type:String,default:''},
12
+ type:{type:String,default:''}, //describes the
13
+ done:{type:String,default:false} //WORKING | READY | COMPLETE
12
14
  }]},
13
15
  driveTime:{type:Date,default:''},
14
16
  startTime:{type:Date,default:''},
@@ -19,6 +21,14 @@ const ticketFinal = require('./final.js')
19
21
  ]
20
22
  */
21
23
 
24
+ /*
25
+ sitems = [{
26
+ id:{type:String,default:''}
27
+ descr:{type:String,default:''}
28
+ needReplace:{type:Boolean:default:false}
29
+ }]
30
+ */
31
+
22
32
  module.exports = {
23
33
  id: { type: String, default: '' },
24
34
  ref: { type: Object, default: {} },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vhp-mongo-models",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "productName": "VHP Mongo Models",
5
5
  "description": "Mongo Models library to setup Mongoose Schemas",
6
6
  "author": "VHPim",