vhp-mongo-models 1.5.7 → 1.5.9
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/schemas/client.js +2 -2
- package/HouseHolds/schemas/home.js +9 -0
- package/HouseHolds/schemas/serviceitem.js +44 -5
- package/Pricing/schemas/financing.js +11 -1
- package/Replacement/schemas/projects.js +0 -1
- package/Service/schemas/activeticket.js +3 -24
- package/Service/schemas/completeticket.js +3 -25
- package/Service/schemas/subs/final.js +8 -11
- package/Service/schemas/subs/ticket.js +52 -0
- package/package.json +1 -1
|
@@ -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:''}, //link in Jonas
|
|
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,5 +1,14 @@
|
|
|
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
|
+
* }]
|
|
3
12
|
*
|
|
4
13
|
* index
|
|
5
14
|
* - hhid - {unique:true,name:"hhid"}
|
|
@@ -1,10 +1,49 @@
|
|
|
1
|
+
|
|
1
2
|
module.exports = [
|
|
2
3
|
{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
hhid:{type:String,default:''}, //must have a hhid
|
|
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
|
|
7
|
+
space:{type:String,default:''},
|
|
8
|
+
subspace:{type:String,default:''},
|
|
9
|
+
quantity:{type:Number,default:1}, //optional qty
|
|
10
|
+
notes:{type:Array,default:[]},// for better history {tech:'',date:'',ticketId:''}
|
|
11
|
+
edits:{type:Object,defualt:{}}, //to track all of the fields that have been changed since sync
|
|
12
|
+
|
|
13
|
+
//JONAS props
|
|
14
|
+
id:{type:String,default:''}, //must have an id, should match JONAS "lineNumber"
|
|
15
|
+
custcode:{type:String,default:''}, //linked custcode in JONAS
|
|
16
|
+
tagid:{type:String,default:''},
|
|
17
|
+
type:{type:String,default:''},//understand what this is in jonas
|
|
18
|
+
descr:{type:String,default:''},
|
|
19
|
+
status:{type:String,default:''},//should be 'A' for active. Need to find other codes. Match JONAS
|
|
20
|
+
insdate:{type:Date,default:''},
|
|
21
|
+
|
|
22
|
+
model:{type:String,default:''},
|
|
23
|
+
serial:{type:String,default:''},
|
|
24
|
+
manf:{type:String,default:''},
|
|
25
|
+
|
|
7
26
|
location:{type:String,default:''},
|
|
8
|
-
|
|
27
|
+
area:{type:String,default:''},
|
|
28
|
+
|
|
29
|
+
controls:{type:String,default:''},
|
|
30
|
+
elec:{type:String,default:''},
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
warr1:{type:Number,default:0},
|
|
34
|
+
warr2:{type:Number,default:0},
|
|
35
|
+
warr3:{type:Number,default:0},
|
|
36
|
+
|
|
37
|
+
expry1:{type:Date,default:''},
|
|
38
|
+
expry2:{type:Date,default:''},
|
|
39
|
+
expry3:{type:Date,default:''},
|
|
40
|
+
|
|
41
|
+
//Custom Info
|
|
42
|
+
filt1:{type:String,default:''},
|
|
43
|
+
filt1q:{type:Number,default:0},
|
|
44
|
+
filt2:{type:String,default:''},
|
|
45
|
+
filt2q:{type:Number,default:0},
|
|
46
|
+
filt3:{type:String,default:''},
|
|
47
|
+
filt3q:{type:Number,default:0}
|
|
9
48
|
}
|
|
10
49
|
]
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
manf:[{
|
|
4
|
+
manufacturer:{type:String,default:''},
|
|
5
|
+
promoRate:{type:Number,default:''},
|
|
6
|
+
credit:{type:Number,default:''}
|
|
7
|
+
}]
|
|
8
|
+
*/
|
|
1
9
|
module.exports=[
|
|
2
10
|
{
|
|
3
|
-
code:{type:String,default:''}, //
|
|
11
|
+
code:{type:String,default:''}, //the financing code
|
|
4
12
|
stdRate:{type:String,default:''}, // versioned | table
|
|
5
13
|
pymntFactor:{type:String,default:''}, // pkid | update date?
|
|
14
|
+
dept:{type:Array,default:''},
|
|
15
|
+
term:{type:String,default:''},
|
|
6
16
|
desc:{type:String,default:''},
|
|
7
17
|
min:{type:Number,default:0},
|
|
8
18
|
max:{type:Number,default:0},
|
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
const
|
|
3
|
-
const wo = require('./subs/jonaswo.js')
|
|
4
|
-
const ticketFinal = require('./subs/final.js')
|
|
2
|
+
const aticket = require('./subs/ticket.js')
|
|
5
3
|
|
|
6
4
|
module.exports = [
|
|
7
5
|
{
|
|
8
|
-
|
|
9
|
-
ref: { type: Object, default: {} },
|
|
6
|
+
...aticket,
|
|
10
7
|
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,
|
|
18
8
|
documents: { type: Array, default: [] },
|
|
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:[]}
|
|
9
|
+
approval:{type:String,default:'NOT'}, // NOT | SENT | APPROVED
|
|
31
10
|
}
|
|
32
11
|
]
|
|
@@ -1,32 +1,10 @@
|
|
|
1
|
+
const aticket = require('./subs/ticket.js')
|
|
1
2
|
|
|
2
|
-
const {aaddress}=require('../../core-models.js');
|
|
3
|
-
const wo = require('./subs/jonaswo.js')
|
|
4
|
-
const ticketFinal = require('./subs/final.js')
|
|
5
3
|
|
|
6
4
|
module.exports = [
|
|
7
5
|
{
|
|
8
|
-
|
|
9
|
-
ref: { type: Object, default: {} },
|
|
6
|
+
...aticket,
|
|
10
7
|
status: { type: String, default: 'complete' }, // active, complete, archived
|
|
11
|
-
|
|
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:[]}
|
|
8
|
+
documents: { type: Array, default: [] } //could get rid of
|
|
31
9
|
}
|
|
32
10
|
]
|
|
@@ -4,32 +4,29 @@ let ticketInvoice = new Schema({
|
|
|
4
4
|
total:{type:Number,default:0},
|
|
5
5
|
pricelevel:{type:String,default:''}
|
|
6
6
|
})
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
endTime:{type:Date,default:''},
|
|
11
|
-
adjustTime:{type:Number,default:0},
|
|
12
|
-
totalTime:{type:Number,default:0},
|
|
13
|
-
repairEstimate:{type:Number,default:0},
|
|
7
|
+
|
|
8
|
+
let repairEstimate = new Schema({
|
|
9
|
+
time:{type:Number,default:0}, //time to complete all repairs
|
|
14
10
|
revenuePerEstimate:{type:Number,default:0},
|
|
15
11
|
revenuePer:{type:Number,default:0}
|
|
16
12
|
})
|
|
17
13
|
|
|
18
14
|
let ticketFinal = new Schema({
|
|
19
15
|
showReplacement:{type:Boolean,default:false},
|
|
16
|
+
summary:{type:Object,default:{}}, //a static version of the presentation
|
|
20
17
|
conform:{type:Object,default:{}},
|
|
21
18
|
invoice:ticketInvoice,
|
|
22
19
|
signature:{type:String,default:''},
|
|
23
20
|
emailed:{type:Boolean,default:false},
|
|
24
|
-
officeSubmit:{type:String,default:''},
|
|
25
21
|
paymentMethod:{type:String,default:''},
|
|
26
|
-
returnVisit:{type:
|
|
22
|
+
returnVisit:{type:String,default:''}, //change to String, and attach return ticket id
|
|
27
23
|
returnNotes:{type:String,default:''},
|
|
28
24
|
addlDetails:{type:String,default:''},
|
|
29
25
|
serviceReferral:{type:Boolean,default:false},
|
|
30
|
-
|
|
26
|
+
repairEstimate:repairEstimate, //was ticketTime
|
|
31
27
|
timelog:{type:Object,default:{}},
|
|
32
|
-
|
|
28
|
+
officeSubmit:{type:String,default:''},
|
|
29
|
+
completedBy:{type:Array,default:[]} //change to string, and tag with the lead who completed
|
|
33
30
|
})
|
|
34
31
|
|
|
35
32
|
module.exports = ticketFinal
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
done:{type:Boolean,default:false}
|
|
12
|
+
}]},
|
|
13
|
+
driveTime:{type:Date,default:''},
|
|
14
|
+
startTime:{type:Date,default:''},
|
|
15
|
+
endTime:{type:Date,default:''},
|
|
16
|
+
adjustTime:{type:Number,default:0},
|
|
17
|
+
totalTime:{type:Number,default:0}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
id: { type: String, default: '' },
|
|
24
|
+
ref: { type: Object, default: {} },
|
|
25
|
+
custid: {type:String, default:''},
|
|
26
|
+
cat:{type:String,default:''}, //converted cat from jonas. Orginal cat can be found in wo.cat
|
|
27
|
+
dept:{type:String,default:''},
|
|
28
|
+
|
|
29
|
+
techs: { type: Array, default: [] },
|
|
30
|
+
techinfo: {type:Object, default:{}}, //hold all info on techs involved
|
|
31
|
+
salesrep:{type:String,default:''},
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
hhid:{type:String,default:''},
|
|
35
|
+
...aaddress, //do not need?
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
checks: { type: Object, default: {} },
|
|
39
|
+
repairs: { type: Object, default: {} },
|
|
40
|
+
sitems: { type: Array, default: [] },
|
|
41
|
+
|
|
42
|
+
todo: {type:Object,default:{}},//used for all todos in workflow.
|
|
43
|
+
//remove the following and merge into 'todo' with a type
|
|
44
|
+
office: { type: Object, default: {} },//any todo items for the office
|
|
45
|
+
field: {type:Object,default:{}},//any todo items for the field
|
|
46
|
+
|
|
47
|
+
final: ticketFinal,
|
|
48
|
+
contract: { type: Object, default: {} }, // the contract attached to the client. Should move off of WO into separate query
|
|
49
|
+
|
|
50
|
+
wo: wo,
|
|
51
|
+
logs:{type:Array,default:[]} //match with project datelog. Would like it to stay as "logs" though
|
|
52
|
+
}
|