vhp-mongo-models 1.6.2 → 1.7.0
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.
- package/HouseHolds/households.js +2 -1
- package/HouseHolds/schemas/checklist.js +14 -0
- package/HouseHolds/schemas/client.js +2 -2
- package/HouseHolds/schemas/home.js +0 -9
- package/HouseHolds/schemas/serviceitem.js +4 -6
- package/Pricing/pricing.js +1 -2
- package/Pricing/schemas/additions.js +6 -15
- package/Pricing/schemas/financing.js +1 -11
- package/Replacement/schemas/projects.js +2 -75
- package/Service/schemas/activeticket.js +25 -5
- package/Service/schemas/completeticket.js +25 -3
- package/Service/schemas/subs/final.js +12 -36
- package/package.json +1 -1
- package/Pricing/schemas/discounts.js +0 -14
- package/Service/schemas/subs/ticket.js +0 -62
package/HouseHolds/households.js
CHANGED
|
@@ -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,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
work = [{
|
|
3
|
+
id:{type:String,default:''},
|
|
4
|
+
type:{type:String,default:''} //project | service
|
|
5
|
+
}]
|
|
6
|
+
*/
|
|
7
|
+
module.exports = [{
|
|
8
|
+
id:{type:String,default:''}, //what checklist was used
|
|
9
|
+
hhid:{type:String,default:''},
|
|
10
|
+
name:{type:String,default:''}, //optional name for THIS checklist
|
|
11
|
+
work:{type:Array,default:[]},
|
|
12
|
+
sitems:{type:Array,default:[]},//of service item ids
|
|
13
|
+
checks:{type:Object,default:{}} //to hold all of the checklist values
|
|
14
|
+
}]
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
module.exports = [
|
|
8
8
|
{
|
|
9
9
|
coid:{type:String,default:''},
|
|
10
|
-
custCode : {type:String,default:''},
|
|
11
|
-
type:{type:String,default:'
|
|
10
|
+
custCode : {type:String,default:''},
|
|
11
|
+
type:{type:String,default:'Owner'}, // Owners | Occupants
|
|
12
12
|
billTo:{type:String,default:''},
|
|
13
13
|
custName:{type:String,default:''},
|
|
14
14
|
clientfirst: { type: String, default: '' },
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
/** Home Schema
|
|
3
|
-
*
|
|
4
|
-
* spaces = [{
|
|
5
|
-
* id:{type:String,default:''},
|
|
6
|
-
* title:{type:String,default:''}
|
|
7
|
-
* subspaces:{type:String,default:[{
|
|
8
|
-
* id:{type:String,default:''},
|
|
9
|
-
* title:{type:String,default:''}
|
|
10
|
-
* }]}
|
|
11
|
-
* }]
|
|
12
3
|
*
|
|
13
4
|
* index
|
|
14
5
|
* - hhid - {unique:true,name:"hhid"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
1
|
module.exports = [
|
|
3
2
|
{
|
|
3
|
+
//VHP ADD fields
|
|
4
4
|
hhid:{type:String,default:''}, //must have a hhid
|
|
5
|
-
|
|
6
|
-
sysid:{type:String,default:''}, //way to link related service items
|
|
5
|
+
system:{type:String,default:''}, //way to link related service items
|
|
7
6
|
space:{type:String,default:''},
|
|
8
7
|
subspace:{type:String,default:''},
|
|
9
8
|
quantity:{type:Number,default:1}, //optional qty
|
|
@@ -23,13 +22,12 @@ module.exports = [
|
|
|
23
22
|
serial:{type:String,default:''},
|
|
24
23
|
manf:{type:String,default:''},
|
|
25
24
|
|
|
26
|
-
location:{type:String,default:''},
|
|
27
|
-
area:{type:String,default:''},
|
|
25
|
+
location:{type:String,default:''},//remove, same as space / sub space
|
|
26
|
+
area:{type:String,default:''},//remove, same as space / sub space
|
|
28
27
|
|
|
29
28
|
controls:{type:String,default:''},
|
|
30
29
|
elec:{type:String,default:''},
|
|
31
30
|
|
|
32
|
-
|
|
33
31
|
warr1:{type:Number,default:0},
|
|
34
32
|
warr2:{type:Number,default:0},
|
|
35
33
|
warr3:{type:Number,default:0},
|
package/Pricing/pricing.js
CHANGED
|
@@ -5,6 +5,5 @@ 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'))
|
|
9
|
-
Discount:new Schema(...require('./schemas/discounts.js'))
|
|
8
|
+
Finance:new Schema(...require('./schemas/financing.js'))
|
|
10
9
|
}
|
|
@@ -2,24 +2,15 @@ module.exports=[
|
|
|
2
2
|
{
|
|
3
3
|
name:{type:String,default:''}, // pricebook / collection name
|
|
4
4
|
notes:{type:String,default:''}, // versioned | table
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
cat:{type:String,default:''}, // pkid | update date?
|
|
6
|
+
type:{type:String,default:''},
|
|
7
7
|
mfg:{type:String,default:''},
|
|
8
8
|
model:{type:String,default:''},
|
|
9
|
+
settings:{type:String,default:''},
|
|
10
|
+
location:{type:Array,default:[]},
|
|
9
11
|
labor:{type:Number,default:0},
|
|
10
12
|
laborpart:{type:Number,default:0},
|
|
11
|
-
|
|
12
|
-
pricededuct:{type:Number,default:0}
|
|
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
|
|
13
|
+
price:{type:Number,default:0},
|
|
14
|
+
pricededuct:{type:Number,default:0}
|
|
16
15
|
}
|
|
17
16
|
]
|
|
18
|
-
|
|
19
|
-
/*
|
|
20
|
-
settings = {
|
|
21
|
-
|
|
22
|
-
location:{type:Array,default:[]},
|
|
23
|
-
swap:{type:Array,default:[]}
|
|
24
|
-
}
|
|
25
|
-
*/
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
manf:[{
|
|
4
|
-
manufacturer:{type:String,default:''},
|
|
5
|
-
promoRate:{type:Number,default:''},
|
|
6
|
-
credit:{type:Number,default:''}
|
|
7
|
-
}]
|
|
8
|
-
*/
|
|
9
1
|
module.exports=[
|
|
10
2
|
{
|
|
11
|
-
code:{type:String,default:''}, //
|
|
3
|
+
code:{type:String,default:''}, // pricebook / collection name
|
|
12
4
|
stdRate:{type:String,default:''}, // versioned | table
|
|
13
5
|
pymntFactor:{type:String,default:''}, // pkid | update date?
|
|
14
|
-
dept:{type:Array,default:''},
|
|
15
|
-
term:{type:String,default:''},
|
|
16
6
|
desc:{type:String,default:''},
|
|
17
7
|
min:{type:Number,default:0},
|
|
18
8
|
max:{type:Number,default:0},
|
|
@@ -10,11 +10,7 @@ const { aaddress, acontact } = require('../../core-models.js');
|
|
|
10
10
|
* photos:{type:Boolean},
|
|
11
11
|
* scheduled:{type:Boolean}
|
|
12
12
|
* }]
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
13
|
+
*/
|
|
18
14
|
let pvmaint = new Schema({
|
|
19
15
|
contractNum:{type:String,default:''},
|
|
20
16
|
rewardNum:{type:String,default:''},
|
|
@@ -43,6 +39,7 @@ let lead = new Schema({
|
|
|
43
39
|
})
|
|
44
40
|
let info = new Schema({
|
|
45
41
|
pkids:{type:Array,default:[]},
|
|
42
|
+
siteinfo:{type:Object,default:{}},
|
|
46
43
|
spaces:{type:Object,default:[]},
|
|
47
44
|
summary:{type:Object,default:{}},
|
|
48
45
|
quotes:{type:Object,default:{}},
|
|
@@ -86,73 +83,3 @@ module.exports=[
|
|
|
86
83
|
toObject: { virtuals: true }
|
|
87
84
|
}
|
|
88
85
|
]
|
|
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
|
-
*/
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
|
|
2
|
-
const
|
|
2
|
+
const {aaddress}=require('../../core-models.js');
|
|
3
|
+
const wo = require('./subs/jonaswo.js')
|
|
4
|
+
const ticketFinal = require('./subs/final.js')
|
|
3
5
|
|
|
4
6
|
module.exports = [
|
|
5
7
|
{
|
|
6
|
-
|
|
8
|
+
id: { type: String, default: '' },
|
|
9
|
+
ref: { type: Object, default: {} },
|
|
7
10
|
status: { type: String, default: 'active' },
|
|
11
|
+
techs: { type: Array, default: [] },
|
|
12
|
+
custid: {type:String, default:''},
|
|
13
|
+
cat:{type:String,default:''},
|
|
14
|
+
dept:{type:String,default:''},
|
|
15
|
+
hhid:{type:String,default:''},
|
|
16
|
+
|
|
17
|
+
...aaddress,
|
|
8
18
|
documents: { type: Array, default: [] },
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
|
|
20
|
+
checks: { type: Array, default: [] },
|
|
21
|
+
conform: { type: Object, default: {} },
|
|
22
|
+
contract: { type: Object, default: {} },
|
|
23
|
+
final: ticketFinal,
|
|
24
|
+
repairs: { type: Array, default: [] },
|
|
25
|
+
salesrep:{type:String,default:''},
|
|
26
|
+
sitems: { type: Array, default: [] },
|
|
27
|
+
wo: wo,
|
|
28
|
+
todo:{type:Object, default: {}},
|
|
29
|
+
office: { type: Object, default: {} },
|
|
30
|
+
logs:{type:Array,default:[]}
|
|
31
|
+
}
|
|
12
32
|
]
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
const aticket = require('./subs/ticket.js')
|
|
2
1
|
|
|
2
|
+
const {aaddress}=require('../../core-models.js');
|
|
3
|
+
const wo = require('./subs/jonaswo.js')
|
|
4
|
+
const ticketFinal = require('./subs/final.js')
|
|
3
5
|
|
|
4
6
|
module.exports = [
|
|
5
7
|
{
|
|
6
|
-
|
|
8
|
+
id: { type: String, default: '' },
|
|
9
|
+
ref: { type: Object, default: {} },
|
|
7
10
|
status: { type: String, default: 'complete' }, // active, complete, archived
|
|
8
|
-
|
|
11
|
+
techs: { type: Array, default: [] },
|
|
12
|
+
custid: {type:String, default:''},
|
|
13
|
+
cat:{type:String,default:''},
|
|
14
|
+
dept:{type:String,default:''},
|
|
15
|
+
hhid:{type:String,default:''},
|
|
16
|
+
documents: { type: Array, default: [] },
|
|
17
|
+
|
|
18
|
+
...aaddress,
|
|
19
|
+
|
|
20
|
+
checks: { type: Array, default: [] },
|
|
21
|
+
conform: { type: Object, default: {} },
|
|
22
|
+
contract: { type: Object, default: {} },
|
|
23
|
+
final: ticketFinal,
|
|
24
|
+
repairs: { type: Array, default: [] },
|
|
25
|
+
salesrep:{type:String,default:''},
|
|
26
|
+
sitems: { type: Array, default: [] },
|
|
27
|
+
wo: wo,
|
|
28
|
+
todo:{type:Object, default: {}}, //remove
|
|
29
|
+
office: { type: Array, default: [] },
|
|
30
|
+
logs:{type:Array,default:[]}
|
|
9
31
|
}
|
|
10
32
|
]
|
|
@@ -4,56 +4,32 @@ let ticketInvoice = new Schema({
|
|
|
4
4
|
total:{type:Number,default:0},
|
|
5
5
|
pricelevel:{type:String,default:''}
|
|
6
6
|
})
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
let ticketTime = new Schema({
|
|
8
|
+
driveTime:{type:Date,default:''},
|
|
9
|
+
startTime:{type:Date,default:''},
|
|
10
|
+
endTime:{type:Date,default:''},
|
|
11
|
+
adjustTime:{type:Number,default:0},
|
|
12
|
+
totalTime:{type:Number,default:0},
|
|
13
|
+
repairEstimate:{type:Number,default:0},
|
|
10
14
|
revenuePerEstimate:{type:Number,default:0},
|
|
11
15
|
revenuePer:{type:Number,default:0}
|
|
12
16
|
})
|
|
13
17
|
|
|
14
18
|
let ticketFinal = new Schema({
|
|
15
19
|
showReplacement:{type:Boolean,default:false},
|
|
16
|
-
summary:{type:Object,default:{}}, //a static version of the presentation
|
|
17
20
|
conform:{type:Object,default:{}},
|
|
18
21
|
invoice:ticketInvoice,
|
|
19
22
|
signature:{type:String,default:''},
|
|
20
23
|
emailed:{type:Boolean,default:false},
|
|
24
|
+
officeSubmit:{type:String,default:''},
|
|
21
25
|
paymentMethod:{type:String,default:''},
|
|
22
|
-
returnVisit:{type:
|
|
26
|
+
returnVisit:{type:Boolean,default:false},
|
|
23
27
|
returnNotes:{type:String,default:''},
|
|
24
28
|
addlDetails:{type:String,default:''},
|
|
25
29
|
serviceReferral:{type:Boolean,default:false},
|
|
26
|
-
|
|
30
|
+
ticketTime:ticketTime,
|
|
27
31
|
timelog:{type:Object,default:{}},
|
|
28
|
-
|
|
29
|
-
completedBy:{type:Array,default:[]} //change to string, lcoaland tag with the lead who completed
|
|
32
|
+
completedBy:{type:Array,default:[]}
|
|
30
33
|
})
|
|
31
34
|
|
|
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
|
-
*/
|
|
35
|
+
module.exports = ticketFinal
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const {aaddress}=require('../../../core-models.js');
|
|
2
|
-
const wo = require('./jonaswo.js')
|
|
3
|
-
const ticketFinal = require('./final.js')
|
|
4
|
-
|
|
5
|
-
/* TECHINFO *
|
|
6
|
-
[
|
|
7
|
-
<user>:{
|
|
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
|
|
14
|
-
}]},
|
|
15
|
-
driveTime:{type:Date,default:''},
|
|
16
|
-
startTime:{type:Date,default:''},
|
|
17
|
-
endTime:{type:Date,default:''},
|
|
18
|
-
adjustTime:{type:Number,default:0},
|
|
19
|
-
totalTime:{type:Number,default:0}
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/*
|
|
25
|
-
sitems = [{
|
|
26
|
-
id:{type:String,default:''}
|
|
27
|
-
descr:{type:String,default:''}
|
|
28
|
-
needReplace:{type:Boolean:default:false}
|
|
29
|
-
}]
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
module.exports = {
|
|
33
|
-
id: { type: String, default: '' },
|
|
34
|
-
ref: { type: Object, default: {} },
|
|
35
|
-
custid: {type:String, default:''},
|
|
36
|
-
cat:{type:String,default:''}, //converted cat from jonas. Orginal cat can be found in wo.cat
|
|
37
|
-
dept:{type:String,default:''},
|
|
38
|
-
|
|
39
|
-
techs: { type: Array, default: [] },
|
|
40
|
-
techinfo: {type:Object, default:{}}, //hold all info on techs involved
|
|
41
|
-
salesrep:{type:String,default:''},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
hhid:{type:String,default:''},
|
|
45
|
-
...aaddress, //do not need?
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
checks: { type: Object, default: {} },
|
|
49
|
-
repairs: { type: Object, default: {} },
|
|
50
|
-
sitems: { type: Array, default: [] },
|
|
51
|
-
|
|
52
|
-
todo: {type:Object,default:{}},//used for all todos in workflow.
|
|
53
|
-
//remove the following and merge into 'todo' with a type
|
|
54
|
-
office: { type: Object, default: {} },//any todo items for the office
|
|
55
|
-
field: {type:Object,default:{}},//any todo items for the field
|
|
56
|
-
|
|
57
|
-
final: ticketFinal,
|
|
58
|
-
contract: { type: Object, default: {} }, // the contract attached to the client. Should move off of WO into separate query
|
|
59
|
-
|
|
60
|
-
wo: wo,
|
|
61
|
-
logs:{type:Array,default:[]} //match with project datelog. Would like it to stay as "logs" though
|
|
62
|
-
}
|