vhp-mongo-models 1.0.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/Company/company.js +30 -0
- package/Company/schemas/account.js +13 -0
- package/Company/schemas/device.js +30 -0
- package/Company/schemas/employee.js +34 -0
- package/Company/schemas/sim.js +17 -0
- package/Document/document.js +6 -0
- package/Document/schemas/replacement.js +14 -0
- package/Document/schemas/service.js +14 -0
- package/HouseHolds/households.js +8 -0
- package/HouseHolds/schemas/client.js +18 -0
- package/HouseHolds/schemas/home.js +60 -0
- package/HouseHolds/schemas/serviceitem.js +10 -0
- package/HouseHolds/schemas/siupdate.js +27 -0
- package/HouseHolds/schemas/system.js +10 -0
- package/Logs/logs.js +5 -0
- package/Logs/schemas/server.js +14 -0
- package/Memberships/memberships.js +6 -0
- package/Memberships/schemas/pvmaint.js +38 -0
- package/Memberships/schemas/rewardmem.js +4 -0
- package/Pricing/pricing.js +7 -0
- package/Pricing/schemas/pricebook.js +9 -0
- package/Pricing/schemas/pricing300.js +8 -0
- package/Pricing/schemas/pricing350.js +8 -0
- package/Pricing/schemas/pricingbee.js +8 -0
- package/Replacement/replacement.js +8 -0
- package/Replacement/schemas/bid.js +18 -0
- package/Replacement/schemas/projectbee.js +66 -0
- package/Replacement/schemas/projects.js +69 -0
- package/Replacement/schemas/setting.js +4 -0
- package/Replacement/schemas/tracking.js +48 -0
- package/Service/schemas/activeticket.js +31 -0
- package/Service/schemas/completeticket.js +31 -0
- package/Service/schemas/spiff.js +24 -0
- package/Service/schemas/spiffreport.js +21 -0
- package/Service/service.js +8 -0
- package/Systems/schemas/app.js +8 -0
- package/Systems/schemas/general.js +4 -0
- package/Systems/schemas/group.js +4 -0
- package/Systems/schemas/user.js +9 -0
- package/Systems/schemas/userprofile.js +13 -0
- package/Systems/schemas/usersetting.js +14 -0
- package/Systems/systems.js +25 -0
- package/TaskManager/schemas/activetask.js +33 -0
- package/TaskManager/schemas/finishedtask.js +33 -0
- package/TaskManager/schemas/todo.js +14 -0
- package/TaskManager/schemas/workflow.js +12 -0
- package/TaskManager/taskmanager.js +8 -0
- package/core-models.js +17 -0
- package/index.js +15 -0
- package/old/CompanySchemes.js +107 -0
- package/old/DocumentSchemes.js +30 -0
- package/old/HistorySchemes.js +39 -0
- package/old/HouseHoldSchemes.js +93 -0
- package/old/LogSchemes.js +14 -0
- package/old/MembershipsSchemes.js +48 -0
- package/old/PricingSchemes.js +15 -0
- package/old/ReplacementSchemes.js +194 -0
- package/old/ReportingSchemes.js +5 -0
- package/old/ServiceItems.js +21 -0
- package/old/ServiceSchemes.js +35 -0
- package/old/SpiffSchemes.js +49 -0
- package/old/SystemsSchemes.js +71 -0
- package/old/WorkFlowSchemes.js +69 -0
- package/old/spares.js +22 -0
- package/package.json +19 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* there is no association to the company accept through the empID. May be needed
|
|
5
|
+
* to create admin accounts to pool un used devices to that company.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const Employee = new Schema(...require('./schemas/employee.js'))
|
|
11
|
+
Employee.virtual('Account',{
|
|
12
|
+
ref:'Account',
|
|
13
|
+
localField:'empID',
|
|
14
|
+
foreignField:'empID'
|
|
15
|
+
})
|
|
16
|
+
Employee.virtual('Device',{
|
|
17
|
+
ref:'Device',
|
|
18
|
+
localField:'empID',
|
|
19
|
+
foreignField:'empID'
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const Device = new Schema(...require('./schemas/device.js'))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
Employee:Employee,
|
|
27
|
+
Device:Device,
|
|
28
|
+
SIM:new Schema(...require('./schemas/sim.js')),
|
|
29
|
+
Account:new Schema(...require('./schemas/account.js'))
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
empID: { type: String, default: '' },
|
|
4
|
+
type: { type: String, default: '' },
|
|
5
|
+
user: { type: String, default: '' }, // email || username
|
|
6
|
+
pswrd: { type: String, default: '' },
|
|
7
|
+
twoFactors: [{ type: String, contact: String }],
|
|
8
|
+
devices: { type: Array, default: [] },
|
|
9
|
+
active: { type: Boolean, default: true },
|
|
10
|
+
admin: { type: Boolean, default: false },
|
|
11
|
+
resetPswrd: { type: Date, default: '' }
|
|
12
|
+
}
|
|
13
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Used for employee devices. They will all carry the assiciated ID. If they do not
|
|
3
|
+
* belong to any one user, the devices are placed.
|
|
4
|
+
*
|
|
5
|
+
* devID - {unique:true,name:"devID"}
|
|
6
|
+
*/
|
|
7
|
+
module.exports=[
|
|
8
|
+
{
|
|
9
|
+
devID: { type: String, default: '' },
|
|
10
|
+
empID: { type: String, default: '' },
|
|
11
|
+
name: { type: String, default: '' },
|
|
12
|
+
type: { type: String, default: '' },
|
|
13
|
+
manf: { type: String, default: '' },
|
|
14
|
+
model: { type: String, default: '' },
|
|
15
|
+
serial: { type: String, default: '' },
|
|
16
|
+
simRef: { type: String, default: '' },
|
|
17
|
+
imei:{type:String,default:''},
|
|
18
|
+
userName: { type: String, default: '' },
|
|
19
|
+
userLock: { type: String, default: '' },
|
|
20
|
+
lock: { type: String, default: '' },
|
|
21
|
+
purchasePrice: { type: Number, default: 0 },
|
|
22
|
+
purchaseDate: { type: Date, default: '' },
|
|
23
|
+
upgradeDate: { type: Date, default: '' },
|
|
24
|
+
notes:{type:String,default:''}
|
|
25
|
+
},{
|
|
26
|
+
toJSON: { virtuals: true },
|
|
27
|
+
toObject: { virtuals: true },
|
|
28
|
+
strictQuery: false
|
|
29
|
+
}
|
|
30
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* To handle all employees from company OR group of companies. The coid can be used
|
|
3
|
+
* to describe the company. Company ids are matching the ids in Jonas.
|
|
4
|
+
*
|
|
5
|
+
* empID - {unique:true,name:"empID"}
|
|
6
|
+
*/
|
|
7
|
+
module.exports=[
|
|
8
|
+
{
|
|
9
|
+
empID: { type: String, default: '' },
|
|
10
|
+
coid: { type: String, default: '' },
|
|
11
|
+
|
|
12
|
+
fName: { type: String, default: '' },
|
|
13
|
+
lName: { type: String, default: '' },
|
|
14
|
+
|
|
15
|
+
dept: {type:String,default:''},
|
|
16
|
+
title: { type: String, default: '' },
|
|
17
|
+
type: { type: String, default: '' },
|
|
18
|
+
repTo: { type: String, default: '' }, // empID
|
|
19
|
+
jobDesc: { type: String, default: '' },
|
|
20
|
+
joined: { type: Date, default: '' },
|
|
21
|
+
bday: { type: Date, default: '' },
|
|
22
|
+
skills: { type: String, default: '' },
|
|
23
|
+
interest: { type: String, default: '' },
|
|
24
|
+
tasks: { type: Array,default:[] },
|
|
25
|
+
active:{ type: Boolean,default:true},
|
|
26
|
+
goals: { type: Array,default:[] },
|
|
27
|
+
picture: { type: String, default: '' },
|
|
28
|
+
}, {
|
|
29
|
+
toJSON: { virtuals: true },
|
|
30
|
+
toObject: { virtuals: true },
|
|
31
|
+
strictQuery: false,
|
|
32
|
+
timestamps: true
|
|
33
|
+
}
|
|
34
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
/** Sim
|
|
4
|
+
* iccid - {unique:true,name:"iccid"}
|
|
5
|
+
* number - { unique: true, sparse:true, name:"number" }
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
module.exports=[
|
|
9
|
+
{
|
|
10
|
+
iccid: { type: String, default: '' },
|
|
11
|
+
name: {type: String, default:''},
|
|
12
|
+
number: {type:String,default:undefined},//is undefined to keep unique even if it is not filled in yet
|
|
13
|
+
group: {type:String,default:''},
|
|
14
|
+
active: {type:Boolean,default:true},
|
|
15
|
+
type: {type:String,default:''}
|
|
16
|
+
}
|
|
17
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
id: { type: String, default: '' },
|
|
4
|
+
cat: { type: String, default: '' },
|
|
5
|
+
html: { type: Array, default: [] },
|
|
6
|
+
css: { type: Array, default: [] },
|
|
7
|
+
filename: { type: String, default: '' },
|
|
8
|
+
type: { type: String, default: '' },
|
|
9
|
+
contentType: { type: String, default: 'application/pdf' }
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
strict:false
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
id: { type: String, default: '' },
|
|
4
|
+
cat: { type: String, default: '' },
|
|
5
|
+
html: { type: Array, default: [] },
|
|
6
|
+
css: { type: Array, default: [] },
|
|
7
|
+
filename: { type: String, default: '' },
|
|
8
|
+
type: { type: String, default: '' },
|
|
9
|
+
contentType: { type: String, default: 'application/pdf' }
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
strict:false
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
Client:new Schema(...require('./schemas/client.js')),
|
|
5
|
+
Home:new Schema(...require('./schemas/home.js')),
|
|
6
|
+
ServiceItem:new Schema(...require('./schemas/serviceitem.js')),
|
|
7
|
+
SIupdate:new Schema(...require('./schemas/siupdate.js'))
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
coid:{type:String,default:''},
|
|
4
|
+
custCode : {type:String,default:''},
|
|
5
|
+
custName:{type:String,default:''},
|
|
6
|
+
fname: { type: String, default: '' },
|
|
7
|
+
lname: { type: String, default: '' },
|
|
8
|
+
contactName:{type:String,default:''},
|
|
9
|
+
phone: { type: String, default: '' }, // id
|
|
10
|
+
phone2: { type: String, default: '' },
|
|
11
|
+
email: { type: String, default: '' },
|
|
12
|
+
linked: { type: Boolean, default:true},
|
|
13
|
+
|
|
14
|
+
createDate: { type: String, default: '' },
|
|
15
|
+
lastTransaction: { type: String, default: '' },
|
|
16
|
+
salesRep: { type: String, default: '' }
|
|
17
|
+
}
|
|
18
|
+
]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
hhid:{type:String,default:''},
|
|
4
|
+
street:{type:String,default:''},
|
|
5
|
+
unit:{type:String,default:''},
|
|
6
|
+
city:{type:String,default:''},
|
|
7
|
+
state:{type:String,default:''},
|
|
8
|
+
zip:{type:String,default:''},
|
|
9
|
+
|
|
10
|
+
lat:{type:Number,default:''},
|
|
11
|
+
lon:{type:Number,default:''},
|
|
12
|
+
|
|
13
|
+
custid:{type:String,default:''},
|
|
14
|
+
|
|
15
|
+
utilities:{type:Object,default:{
|
|
16
|
+
eleccomp:'',
|
|
17
|
+
gascomp:''
|
|
18
|
+
}},
|
|
19
|
+
activeProjects:{type:Array,default:[]},
|
|
20
|
+
activeService:{type:Array,default:[]},
|
|
21
|
+
measurements:{type:Object,default:{}},
|
|
22
|
+
features:{
|
|
23
|
+
elecService:{
|
|
24
|
+
panel:{type:String,default:''},
|
|
25
|
+
serviceSize:{type:String,default:''},
|
|
26
|
+
wireType:{type:String,default:''},
|
|
27
|
+
provider:{type:String,default:''}
|
|
28
|
+
},
|
|
29
|
+
gasService:{
|
|
30
|
+
provider:{type:String,default:''},
|
|
31
|
+
type:{type:String,default:''}
|
|
32
|
+
},
|
|
33
|
+
roof:{
|
|
34
|
+
roofTint:{type:String,default:''},
|
|
35
|
+
roofMake:{type:String,default:''},
|
|
36
|
+
pitch:{type:String,default:''},
|
|
37
|
+
gutters:{
|
|
38
|
+
material:{type:String,default:''},
|
|
39
|
+
feet:{type:Number,default:0}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
waterheater:{
|
|
43
|
+
capacity:{type:Number,default:0},
|
|
44
|
+
btus:{type:Number,default:0},
|
|
45
|
+
type:{type:String,default:''},
|
|
46
|
+
condition:{type:Number,default:''}
|
|
47
|
+
},
|
|
48
|
+
foundation:{type:String,default:''},
|
|
49
|
+
frontFace:{type:String,default:''},
|
|
50
|
+
buildYear:{type:Number,default:0},
|
|
51
|
+
sqft:{type:Number,default:0},
|
|
52
|
+
floors:{type:Number,default:0},
|
|
53
|
+
baths:{type:Number,default:0},
|
|
54
|
+
rooms:{type:Number,default:0}
|
|
55
|
+
},
|
|
56
|
+
spaces:{type:Array,default:[]},
|
|
57
|
+
systems:{type:Array,default:[]},
|
|
58
|
+
froot:{type:String,default:''}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
edits:{type:Object,default:null},
|
|
4
|
+
new:{type:Boolean,default:false},
|
|
5
|
+
custcode:{type:String,default:''},
|
|
6
|
+
id:{type:String,default:''},
|
|
7
|
+
tagid:{type:String,default:''},
|
|
8
|
+
descr:{type:String,default:''},
|
|
9
|
+
qnty:{type:String,default:''},
|
|
10
|
+
manf:{type:String,default:''},
|
|
11
|
+
model:{type:String,default:''},
|
|
12
|
+
serial:{type:String,default:''},
|
|
13
|
+
type:{type:String,default:''},
|
|
14
|
+
installdate:{type:String,default:''},
|
|
15
|
+
installby:{type:String,default:''},
|
|
16
|
+
warr1:{type:String,default:''},
|
|
17
|
+
expry1:{type:String,default:''},
|
|
18
|
+
warr2:{type:String,default:''},
|
|
19
|
+
expry2:{type:String,default:''},
|
|
20
|
+
warr3:{type:String,default:''},
|
|
21
|
+
expry3:{type:String,default:''},
|
|
22
|
+
location:{type:String,default:''},
|
|
23
|
+
area:{type:String,default:''},
|
|
24
|
+
status:{type:String,default:''}
|
|
25
|
+
},
|
|
26
|
+
{strict:false}
|
|
27
|
+
]
|
package/Logs/logs.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
id: { type: String, default: '' },
|
|
4
|
+
cat: { type: String, default: '' },
|
|
5
|
+
html: { type: Array, default: [] },
|
|
6
|
+
css: { type: Array, default: [] },
|
|
7
|
+
filename: { type: String, default: '' },
|
|
8
|
+
type: { type: String, default: '' },
|
|
9
|
+
contentType: { type: String, default: 'application/pdf' }
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
strict:false
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
jobref: { type: String, default: '' },
|
|
4
|
+
|
|
5
|
+
contractNum: { type: String, default: '' },
|
|
6
|
+
custCode: { type: String, default: '' },
|
|
7
|
+
custName: { type: String, default: '' },
|
|
8
|
+
|
|
9
|
+
status: { type: String, default: 'A' },
|
|
10
|
+
renewed: { type: Boolean, default: false },
|
|
11
|
+
|
|
12
|
+
installers: { type: Array, default: [] },
|
|
13
|
+
|
|
14
|
+
street: { type: String, default: '' },
|
|
15
|
+
unit: { type: String, default: '' },
|
|
16
|
+
state: { type: String, default: '' },
|
|
17
|
+
zip: { type: String, default: '' },
|
|
18
|
+
|
|
19
|
+
phone: { type: String, default: '' },
|
|
20
|
+
email: { type: String, default: '' },
|
|
21
|
+
|
|
22
|
+
notes: { type: String, default: '' },
|
|
23
|
+
|
|
24
|
+
visits: { type: Array, default: [] },
|
|
25
|
+
|
|
26
|
+
coolingdate: { type: Date, default: '' },
|
|
27
|
+
coolingscheduled: { type: Boolean, default: false },
|
|
28
|
+
heatingdate: { type: Date, default: '' },
|
|
29
|
+
heatingscheduled: { type: Boolean, default: false },
|
|
30
|
+
|
|
31
|
+
//move to review section
|
|
32
|
+
coolingcheck: { type: Date, default: '' },
|
|
33
|
+
coolingphotos: { type: Boolean, default: false },
|
|
34
|
+
|
|
35
|
+
heatingphotos: { type: Boolean, default: false },
|
|
36
|
+
heatingcheck: { type: Date, default: '' }
|
|
37
|
+
}
|
|
38
|
+
]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
module.exports={
|
|
3
|
+
PriceBook:new Schema(...require('./schemas/pricebook.js')),
|
|
4
|
+
Pricing350:new Schema(...require('./schemas/pricing350.js')),
|
|
5
|
+
PricingBEE:new Schema(...require('./schemas/pricingbee.js')),
|
|
6
|
+
Pricing300:new Schema(...require('./schemas/pricing300.js'))
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
name:{type:String,default:''}, // pricebook / collection name
|
|
4
|
+
type:{type:String,default:''}, // versioned | table
|
|
5
|
+
current:{type:String,default:''}, // pkid | update date?
|
|
6
|
+
dept:{type:String,default:''},
|
|
7
|
+
user:{type:Array,default:[]}
|
|
8
|
+
}
|
|
9
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const {Schema} = require('mongoose');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
Project:new Schema(...require('./schemas/projects.js')),
|
|
5
|
+
Bid:new Schema(...require('./schemas/bid.js')),
|
|
6
|
+
Tracking:new Schema(...require('./schemas/tracking.js')),
|
|
7
|
+
Setting:new Schema(...require('./schemas/setting.js'))
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
projectId:{type:String,default:''}, //was ref
|
|
4
|
+
hhid:{type:String,default:''}, //new
|
|
5
|
+
dept:{type:String,default:''},
|
|
6
|
+
cat:{type:String,default:''},
|
|
7
|
+
type:{type:String,default:''},
|
|
8
|
+
bookprice:{type:Boolean,default:true},
|
|
9
|
+
amntTotal:{type:Number,default:0},
|
|
10
|
+
amntCust:{type:Number,default:0},
|
|
11
|
+
amntAmeren:{type:Number,default:0},
|
|
12
|
+
amntManf:{type:Number,default:0},
|
|
13
|
+
amntSpecial:{type:Number,default:0},
|
|
14
|
+
sold:{type:Date,default:''},
|
|
15
|
+
invoiced:{type:Date,default:''},
|
|
16
|
+
paid:{type:Date,default:''}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
const { aaddress, acontact } = require('../../core-models.js');
|
|
3
|
+
/** ProjectBEE Schema
|
|
4
|
+
*
|
|
5
|
+
* index
|
|
6
|
+
* - id - {unique:true,name:"id"}
|
|
7
|
+
*/
|
|
8
|
+
module.exports=[
|
|
9
|
+
{
|
|
10
|
+
id: { type: String, default: '' },
|
|
11
|
+
name: { type: String, default: '' },
|
|
12
|
+
|
|
13
|
+
jobnum: { type: String, default: '' },
|
|
14
|
+
|
|
15
|
+
hhid: { type: String, default: '' },
|
|
16
|
+
clientfirst: { type: String, default: '' },
|
|
17
|
+
clientlast: { type: String, default: '' },
|
|
18
|
+
...aaddress,
|
|
19
|
+
...acontact,
|
|
20
|
+
|
|
21
|
+
estimator: { type: String, default: '' },
|
|
22
|
+
techs: { type: Array, default: [] },
|
|
23
|
+
|
|
24
|
+
dept: { type: String, default: '' },
|
|
25
|
+
cat: { type: String, default: '' },
|
|
26
|
+
|
|
27
|
+
stage: { type: String, default: 'quote' },
|
|
28
|
+
status: { type: String, default: 'active' },
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
opendate: { type: Date, default: Date.now() },
|
|
32
|
+
lastdate: { type: Date, default: Date.now() },
|
|
33
|
+
solddate: { type: Date, default: '' },
|
|
34
|
+
scheddate: { type: Date, default: '' }, //get rid of eventually?
|
|
35
|
+
closedate: { type: Date, default: '' },
|
|
36
|
+
|
|
37
|
+
datelog: { type: Array, default: [] },
|
|
38
|
+
|
|
39
|
+
info: { type: Object, default: {} },
|
|
40
|
+
contracts:{type:Array, default:[]},
|
|
41
|
+
|
|
42
|
+
lead:{
|
|
43
|
+
type:Object,
|
|
44
|
+
default:{
|
|
45
|
+
apptdate:{type:Date,default:''},
|
|
46
|
+
prstdate:{type:Date,default:''},
|
|
47
|
+
time:{type:String,default:''},
|
|
48
|
+
carryover:{type:Boolean,default:false},
|
|
49
|
+
prstvia:{type:String,default:''},
|
|
50
|
+
rewards:{type:Boolean,default:false},
|
|
51
|
+
source:{type:String,default:''},
|
|
52
|
+
generator:{type:String,default:''},
|
|
53
|
+
paid:{type:Date,default:''}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
trackid: { type: String, default: null },//holds doc id for tracking
|
|
57
|
+
refs:{type:Array, default:[]}, //remove?
|
|
58
|
+
wos:{type:Array, default:[]},
|
|
59
|
+
|
|
60
|
+
froot: { type: String, default: '' }
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
toJSON: { virtuals: true },
|
|
64
|
+
toObject: { virtuals: true }
|
|
65
|
+
}
|
|
66
|
+
]
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
const { aaddress, acontact } = require('../../core-models.js');
|
|
3
|
+
|
|
4
|
+
/** Projects Schema
|
|
5
|
+
*
|
|
6
|
+
* index
|
|
7
|
+
* - id - {unique:true,name:"id"}
|
|
8
|
+
*/
|
|
9
|
+
module.exports=[
|
|
10
|
+
{
|
|
11
|
+
id: { type: String, default: '' },
|
|
12
|
+
name: { type: String, default: '' },
|
|
13
|
+
|
|
14
|
+
jobnum: { type: String, default: '' },
|
|
15
|
+
ref:{type:String,default:''},
|
|
16
|
+
hhid: { type: String, default: '' },
|
|
17
|
+
custid:{type:String,default:''},
|
|
18
|
+
clientfirst: { type: String, default: '' },
|
|
19
|
+
clientlast: { type: String, default: '' },
|
|
20
|
+
...aaddress,
|
|
21
|
+
...acontact,
|
|
22
|
+
|
|
23
|
+
estimator: { type: String, default: '' },
|
|
24
|
+
techs: { type: Array, default: [] },
|
|
25
|
+
|
|
26
|
+
dept: { type: String, default: '' },
|
|
27
|
+
cat: { type: String, default: '' },
|
|
28
|
+
|
|
29
|
+
stage: { type: String, default: 'quote' },
|
|
30
|
+
status: { type: String, default: 'active' },
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
opendate: { type: Date, default: Date.now() },
|
|
34
|
+
lastdate: { type: Date, default: Date.now() },
|
|
35
|
+
solddate: { type: Date, default: '' },
|
|
36
|
+
scheddate: { type: Date, default: '' }, //get rid of eventually?
|
|
37
|
+
closedate: { type: Date, default: '' },
|
|
38
|
+
|
|
39
|
+
datelog: { type: Array, default: [] },
|
|
40
|
+
|
|
41
|
+
info: { type: Object, default: {} },
|
|
42
|
+
contracts:{type:Array, default:[]},
|
|
43
|
+
|
|
44
|
+
lead:{
|
|
45
|
+
type:Object,
|
|
46
|
+
default:{
|
|
47
|
+
apptdate:{type:Date,default:''},
|
|
48
|
+
prstdate:{type:Date,default:''},
|
|
49
|
+
time:{type:String,default:''},
|
|
50
|
+
carryover:{type:Date,default:''},
|
|
51
|
+
prstvia:{type:String,default:''},
|
|
52
|
+
time:{type:String,default:''},
|
|
53
|
+
rewards:{type:Boolean,default:false},
|
|
54
|
+
source:{type:String,default:''},
|
|
55
|
+
generator:{type:String,default:''},
|
|
56
|
+
paid:{type:Date,default:''}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
trackid: { type: String, default: null },//holds doc id for tracking
|
|
60
|
+
refs:{type:Array, default:[]}, //remove?
|
|
61
|
+
wos:{type:Array, default:[]},
|
|
62
|
+
|
|
63
|
+
froot: { type: String, default: '' }
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
toJSON: { virtuals: true },
|
|
67
|
+
toObject: { virtuals: true }
|
|
68
|
+
}
|
|
69
|
+
]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
const { aaddress, acontact } = require('../../core-models.js');
|
|
3
|
+
|
|
4
|
+
/** Tracking Scheme
|
|
5
|
+
*
|
|
6
|
+
* index
|
|
7
|
+
* - id - {unique:true,name:"id"}
|
|
8
|
+
*/
|
|
9
|
+
module.exports=[
|
|
10
|
+
{
|
|
11
|
+
id: { type: String, default: '' }, // unique, given to item being tracked
|
|
12
|
+
projectname: { type: String, default: '' },
|
|
13
|
+
ref: { type: Array, default: [] },
|
|
14
|
+
estimator: { type: String, default: '' },
|
|
15
|
+
|
|
16
|
+
cancelled: { type: Boolean, default: false },
|
|
17
|
+
carryover: { type: Boolean, default: false },
|
|
18
|
+
|
|
19
|
+
bids: { type: Array, default: [] }, // holds list of bid items
|
|
20
|
+
|
|
21
|
+
stage: { type: String, default: '' }, // quote || job || archived
|
|
22
|
+
status: { type: String, default: '' }, //
|
|
23
|
+
|
|
24
|
+
clientfirst: { type: String, default: '' }, // moved so this block is "Job Info" while above is "Contact Info"
|
|
25
|
+
clientlast: { type: String, default: '' },
|
|
26
|
+
...aaddress,
|
|
27
|
+
...acontact,
|
|
28
|
+
|
|
29
|
+
datelog: {
|
|
30
|
+
type: Array, default: [{
|
|
31
|
+
date: Date.now,
|
|
32
|
+
msg: 'Track Created'
|
|
33
|
+
}]
|
|
34
|
+
},//date of
|
|
35
|
+
apptdate: { type: Date, default: '' }, // was date
|
|
36
|
+
solddate: { type: Date, default: '' }, // should be there
|
|
37
|
+
|
|
38
|
+
time: { type: String, default: '' },
|
|
39
|
+
source: { type: String, default: '' },
|
|
40
|
+
generator: { type: String, default: '' }, // changed from "lead"; will need a cleanup!
|
|
41
|
+
//leadref: { type: String, default: '' }, // now directly part of generator
|
|
42
|
+
prstvia: { type: String, default: null },
|
|
43
|
+
prstdate: { type: Date, default: Date.now },
|
|
44
|
+
rewards: { type: Boolean, default: false },
|
|
45
|
+
|
|
46
|
+
amount: { type: Number, default: 0 } // how are we saving the breakdown now (Ameren, Manf, etc.)?
|
|
47
|
+
}
|
|
48
|
+
]
|