vhp-mongo-models 1.5.8 → 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 +16 -13
- package/Pricing/schemas/financing.js +11 -1
- package/Service/schemas/activeticket.js +3 -43
- package/Service/schemas/completeticket.js +3 -25
- package/Service/schemas/subs/final.js +1 -0
- package/Service/schemas/subs/ticket.js +41 -5
- 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,18 +1,21 @@
|
|
|
1
|
+
|
|
1
2
|
module.exports = [
|
|
2
3
|
{
|
|
3
4
|
hhid:{type:String,default:''}, //must have a hhid
|
|
4
|
-
id:{type:String,default:''}, //must have an id, should match JONAS
|
|
5
5
|
group:{type:String,default:''},//names the type of product it is. Would like to use this instead of type
|
|
6
6
|
sysid:{type:String,default:''}, //way to link related service items
|
|
7
7
|
space:{type:String,default:''},
|
|
8
8
|
subspace:{type:String,default:''},
|
|
9
9
|
quantity:{type:Number,default:1}, //optional qty
|
|
10
|
-
notes:{type:
|
|
11
|
-
|
|
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
|
+
|
|
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
|
|
13
16
|
tagid:{type:String,default:''},
|
|
14
17
|
type:{type:String,default:''},//understand what this is in jonas
|
|
15
|
-
|
|
18
|
+
descr:{type:String,default:''},
|
|
16
19
|
status:{type:String,default:''},//should be 'A' for active. Need to find other codes. Match JONAS
|
|
17
20
|
insdate:{type:Date,default:''},
|
|
18
21
|
|
|
@@ -26,21 +29,21 @@ module.exports = [
|
|
|
26
29
|
controls:{type:String,default:''},
|
|
27
30
|
elec:{type:String,default:''},
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
filt1q:{type:Number,default:0},
|
|
31
|
-
filt2:{type:String,default:''},
|
|
32
|
-
filt2q:{type:Number,default:0},
|
|
33
|
-
filt3:{type:String,default:''},
|
|
34
|
-
filt3q:{type:Number,default:0},
|
|
35
|
-
|
|
32
|
+
|
|
36
33
|
warr1:{type:Number,default:0},
|
|
37
34
|
warr2:{type:Number,default:0},
|
|
38
35
|
warr3:{type:Number,default:0},
|
|
39
|
-
|
|
36
|
+
|
|
40
37
|
expry1:{type:Date,default:''},
|
|
41
38
|
expry2:{type:Date,default:''},
|
|
42
39
|
expry3:{type:Date,default:''},
|
|
43
40
|
|
|
44
|
-
|
|
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}
|
|
45
48
|
}
|
|
46
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,51 +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
|
-
|
|
7
|
-
/* TECHINFO *
|
|
8
|
-
[
|
|
9
|
-
<user>:{
|
|
10
|
-
name:{type:String,default:''},
|
|
11
|
-
assigned:{type:Array,default:[{
|
|
12
|
-
id:{type:String,default:''}, //the service item id
|
|
13
|
-
done:{type:Boolean,default:false}
|
|
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
4
|
module.exports = [
|
|
24
5
|
{
|
|
25
|
-
|
|
26
|
-
ref: { type: Object, default: {} },
|
|
6
|
+
...aticket,
|
|
27
7
|
status: { type: String, default: 'active' },
|
|
28
|
-
techs: { type: Array, default: [] },
|
|
29
|
-
techinfo: {type:Object, default:{}}, //hold all info on techs involved
|
|
30
|
-
custid: {type:String, default:''},
|
|
31
|
-
cat:{type:String,default:''},
|
|
32
|
-
dept:{type:String,default:''},
|
|
33
|
-
hhid:{type:String,default:''},
|
|
34
|
-
|
|
35
|
-
...aaddress,
|
|
36
8
|
documents: { type: Array, default: [] },
|
|
37
|
-
|
|
38
|
-
checks: { type: Array, default: [] },
|
|
39
|
-
conform: { type: Object, default: {} },
|
|
40
|
-
contract: { type: Object, default: {} },
|
|
41
|
-
final: ticketFinal,
|
|
42
|
-
repairs: { type: Array, default: [] },
|
|
43
|
-
salesrep:{type:String,default:''},
|
|
44
|
-
sitems: { type: Array, default: [] },
|
|
45
|
-
wo: wo,
|
|
46
|
-
todo:{type:Object, default: {}}, //this should be replaced by office
|
|
47
|
-
office: { type: Object, default: {} },//any todo items for the office
|
|
48
|
-
field: {type:Object,default:{}},//any todo items for the field
|
|
49
|
-
logs:{type:Array,default:[]}
|
|
9
|
+
approval:{type:String,default:'NOT'}, // NOT | SENT | APPROVED
|
|
50
10
|
}
|
|
51
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
|
]
|
|
@@ -13,6 +13,7 @@ let repairEstimate = new Schema({
|
|
|
13
13
|
|
|
14
14
|
let ticketFinal = new Schema({
|
|
15
15
|
showReplacement:{type:Boolean,default:false},
|
|
16
|
+
summary:{type:Object,default:{}}, //a static version of the presentation
|
|
16
17
|
conform:{type:Object,default:{}},
|
|
17
18
|
invoice:ticketInvoice,
|
|
18
19
|
signature:{type:String,default:''},
|
|
@@ -2,15 +2,51 @@ const {aaddress}=require('../../../core-models.js');
|
|
|
2
2
|
const wo = require('./jonaswo.js')
|
|
3
3
|
const ticketFinal = require('./final.js')
|
|
4
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
|
+
|
|
5
22
|
module.exports = {
|
|
6
23
|
id: { type: String, default: '' },
|
|
7
24
|
ref: { type: Object, default: {} },
|
|
8
|
-
status: { type: String, default: 'active' },
|
|
9
|
-
techs: { type: Array, default: [] },
|
|
10
|
-
techinfo: {type:Object, default:{}}, //hold all info on techs involved
|
|
11
25
|
custid: {type:String, default:''},
|
|
12
|
-
cat:{type:String,default:''},
|
|
26
|
+
cat:{type:String,default:''}, //converted cat from jonas. Orginal cat can be found in wo.cat
|
|
13
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
|
+
|
|
14
34
|
hhid:{type:String,default:''},
|
|
15
|
-
...aaddress,
|
|
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
|
|
16
52
|
}
|