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,31 @@
|
|
|
1
|
+
|
|
2
|
+
const {aaddress}=require('../../core-models.js');
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
id: { type: String, default: '' },
|
|
8
|
+
ref: { type: Object, default: {} },
|
|
9
|
+
status: { type: String, default: 'active' }, // active, archived, invoice,
|
|
10
|
+
techs: { type: Array, default: [] },
|
|
11
|
+
custid: {type:String, default:''},
|
|
12
|
+
cat:{type:String,default:''},
|
|
13
|
+
dept:{type:String,default:''},
|
|
14
|
+
hhid:{type:String,default:''},
|
|
15
|
+
|
|
16
|
+
...aaddress,
|
|
17
|
+
documents: { type: Array, default: [] },
|
|
18
|
+
|
|
19
|
+
checks: { type: Array, default: [] },
|
|
20
|
+
conform: { type: Object, default: {} },
|
|
21
|
+
contract: { type: Object, default: {} },
|
|
22
|
+
final: { type: Object, default: {} },
|
|
23
|
+
repairs: { type: Array, default: [] },
|
|
24
|
+
salesrep:{type:String,default:''},
|
|
25
|
+
sitems: { type: Array, default: [] },
|
|
26
|
+
wo: { type: Object, default: {} },
|
|
27
|
+
todo:{type:Object, default: {}},
|
|
28
|
+
office: { type: Object, default: {} },
|
|
29
|
+
logs:{type:Array,default:[]}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
const {aaddress}=require('../../core-models.js');
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
id: { type: String, default: '' },
|
|
8
|
+
ref: { type: Object, default: {} },
|
|
9
|
+
status: { type: String, default: 'active' }, // active, archived, invoice,
|
|
10
|
+
techs: { type: Array, default: [] },
|
|
11
|
+
custid: {type:String, default:''},
|
|
12
|
+
cat:{type:String,default:''},
|
|
13
|
+
dept:{type:String,default:''},
|
|
14
|
+
hhid:{type:String,default:''},
|
|
15
|
+
|
|
16
|
+
...aaddress,
|
|
17
|
+
documents: { type: Array, default: [] },
|
|
18
|
+
|
|
19
|
+
checks: { type: Array, default: [] },
|
|
20
|
+
conform: { type: Object, default: {} },
|
|
21
|
+
contract: { type: Object, default: {} },
|
|
22
|
+
final: { type: Object, default: {} },
|
|
23
|
+
repairs: { type: Array, default: [] },
|
|
24
|
+
salesrep:{type:String,default:''},
|
|
25
|
+
sitems: { type: Array, default: [] },
|
|
26
|
+
wo: { type: Object, default: {} },
|
|
27
|
+
todo:{type:Object, default: {}},
|
|
28
|
+
office: { type: Object, default: {} },
|
|
29
|
+
logs:{type:Array,default:[]}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
FormID: { type: String, default: '' },
|
|
4
|
+
TechID: { type: String, default: '' },
|
|
5
|
+
TechLName: { type: String, default: '' },
|
|
6
|
+
TechFName: { type: String, default: '' },
|
|
7
|
+
Date: { type: Date, default: '' },
|
|
8
|
+
WO: { type: String, default: '' },
|
|
9
|
+
Address: { type: String, default: '' },
|
|
10
|
+
CustLName: { type: String, default: '' },
|
|
11
|
+
CustFName: { type: String, default: '' },
|
|
12
|
+
ReferTo: { type: String, default: '' },
|
|
13
|
+
SpiffFor: { type: String, default: '' },
|
|
14
|
+
status: { type: String, default: '' },
|
|
15
|
+
paid: { type: String, default: '' },
|
|
16
|
+
comments: { type: Array, default: [] },
|
|
17
|
+
closedate: { type: Date, default: '' },
|
|
18
|
+
reportmonth: { type: String, default: '' },
|
|
19
|
+
reportid: { type: String, default: '' },
|
|
20
|
+
lastdate: { type: Date, default: '' },
|
|
21
|
+
editor: { type: Array, defualt: [] },
|
|
22
|
+
reportStatus: { type: String, deafult: '' }
|
|
23
|
+
}
|
|
24
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
id: { type: String, default: '' },
|
|
4
|
+
cleaned: { type: Boolean, default: false },
|
|
5
|
+
comInfo: {
|
|
6
|
+
type: Object, default: {
|
|
7
|
+
lost: 0,
|
|
8
|
+
approved: 0,
|
|
9
|
+
commission: 0,
|
|
10
|
+
open: 0,
|
|
11
|
+
submitted: 0
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
document: { type: Object, default: {} },
|
|
15
|
+
spiffTypes: { type: Object, default: {} },
|
|
16
|
+
closedate: { type: Date, default: '' },
|
|
17
|
+
month: { type: String, default: '' },
|
|
18
|
+
runner: { type: String, default: '' },
|
|
19
|
+
techs: { type: Object, default: {} }
|
|
20
|
+
}
|
|
21
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
ActiveTicket:new Schema(...require('./schemas/activeticket.js')),
|
|
5
|
+
CompleteTicket:new Schema(...require('./schemas/completeticket.js')),
|
|
6
|
+
Spiff:new Schema(...require('./schemas/spiff.js')),
|
|
7
|
+
SpiffReport:new Schema(...require('./schemas/spiffreport.js'))
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
{
|
|
3
|
+
type:{type:String,default:''},
|
|
4
|
+
apps:{type:Object,default:{}},
|
|
5
|
+
admin:{type:Boolean,default:false},
|
|
6
|
+
permissions:{type:Array,default:[]}
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
toJSON: { virtuals: true },
|
|
10
|
+
toObject: { virtuals: true },
|
|
11
|
+
strictQuery: false,
|
|
12
|
+
}
|
|
13
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
empID:{type:String,default:''},
|
|
4
|
+
user:{type:String,defaullt:''},
|
|
5
|
+
type:{type:String,default:''},//optional to connect to a UserProfile
|
|
6
|
+
apps:{type:Object,default:{}},
|
|
7
|
+
admin:{type:Boolean,default:false},
|
|
8
|
+
permissions:{type:Array,default:[]}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
toJSON: { virtuals: true },
|
|
12
|
+
toObject: { virtuals: true }
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const UserSetting = new Schema(...require('./schemas/usersetting.js'));
|
|
4
|
+
|
|
5
|
+
UserSetting.virtual('profile',{
|
|
6
|
+
ref:'UserProfile',
|
|
7
|
+
localField:'type',
|
|
8
|
+
foreignField:'type'
|
|
9
|
+
})
|
|
10
|
+
UserSetting.virtual('employee',{
|
|
11
|
+
ref:'Employee',
|
|
12
|
+
localField:'empID',
|
|
13
|
+
foreignField:'empID'
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const UserProfile = new Schema(...require('./schemas/userprofile.js'))
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
User:new Schema(...require('./schemas/user.js')),
|
|
20
|
+
UserSetting:UserSetting,
|
|
21
|
+
UserProfile:UserProfile,
|
|
22
|
+
App:new Schema(...require('./schemas/app.js')),
|
|
23
|
+
General:new Schema(...require('./schemas/general.js')),
|
|
24
|
+
Group:new Schema(...require('./schemas/group.js'))
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
startdate: {type:Date, default:Date.now()},
|
|
4
|
+
duedate:{ type:Date,default:''},
|
|
5
|
+
finishdate:{ type:Date,default:''},
|
|
6
|
+
|
|
7
|
+
complete:{ type:Boolean,default:false},
|
|
8
|
+
level:{ type:String,default:'0'},//0-5
|
|
9
|
+
|
|
10
|
+
workflow:{type:String, default:''}, //id of workflow
|
|
11
|
+
flow: { type:String, default:''}, //id of flow in workflow
|
|
12
|
+
group: { type: String, default: '' }, // refering to database
|
|
13
|
+
work: { type: String, default: '' }, // refering to the collection
|
|
14
|
+
dept: { type: String, default: ''},
|
|
15
|
+
ref: { type: String, default: '' }, // refering to an item in the collection
|
|
16
|
+
type: { type: String, default: ''}, //to identify the type
|
|
17
|
+
assignees: { type: Array, default: [] },
|
|
18
|
+
|
|
19
|
+
checks: { type: Object, default: {} }, // for specific review checks
|
|
20
|
+
|
|
21
|
+
followup: { type: Boolean, default: false },
|
|
22
|
+
employees: { type: Array, default: [] },
|
|
23
|
+
notes: { type: String, default: '' },
|
|
24
|
+
notify: { type: Array, default: [] },
|
|
25
|
+
comments: { type: Array, default: [] },
|
|
26
|
+
logs: {// this is datelog in projects, should we align?
|
|
27
|
+
type: Array, default: [{
|
|
28
|
+
date: Date.now,
|
|
29
|
+
msg: 'Review Created'
|
|
30
|
+
}]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
startdate: {type:Date, default:Date.now()},
|
|
4
|
+
duedate:{ type:Date,default:''},
|
|
5
|
+
finishdate:{ type:Date,default:''},
|
|
6
|
+
|
|
7
|
+
complete:{ type:Boolean,default:false},
|
|
8
|
+
level:{ type:String,default:'0'},//0-5
|
|
9
|
+
|
|
10
|
+
workflow:{type:String, default:''}, //id of workflow
|
|
11
|
+
flow: { type:String, default:''}, //id of flow in workflow
|
|
12
|
+
group: { type: String, default: '' }, // refering to database
|
|
13
|
+
work: { type: String, default: '' }, // refering to the collection
|
|
14
|
+
dept: { type: String, default: ''},
|
|
15
|
+
ref: { type: String, default: '' }, // refering to an item in the collection
|
|
16
|
+
type: { type: String, default: ''}, //to identify the type
|
|
17
|
+
assignees: { type: Array, default: [] },
|
|
18
|
+
|
|
19
|
+
checks: { type: Object, default: {} }, // for specific review checks
|
|
20
|
+
|
|
21
|
+
followup: { type: Boolean, default: false },
|
|
22
|
+
employees: { type: Array, default: [] },
|
|
23
|
+
notes: { type: String, default: '' },
|
|
24
|
+
notify: { type: Array, default: [] },
|
|
25
|
+
comments: { type: Array, default: [] },
|
|
26
|
+
logs: {// this is datelog in projects, should we align?
|
|
27
|
+
type: Array, default: [{
|
|
28
|
+
date: Date.now,
|
|
29
|
+
msg: 'Review Created'
|
|
30
|
+
}]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
type:{type:String,default:''}, // work | watching
|
|
4
|
+
workflow:{type:String,default:''}
|
|
5
|
+
|
|
6
|
+
// type watching only -
|
|
7
|
+
// list:{type:Array,default:[]} // all of the active work
|
|
8
|
+
|
|
9
|
+
// type work only -
|
|
10
|
+
// todo:{type:Object,default:{}}
|
|
11
|
+
// ref: {type:String,default:''} // id of work
|
|
12
|
+
//
|
|
13
|
+
}, {strict: false}
|
|
14
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports=[
|
|
2
|
+
{
|
|
3
|
+
id:{type:String,default:''},
|
|
4
|
+
name:{type:String,default:''},
|
|
5
|
+
dept:{type:String,default:''},
|
|
6
|
+
group:{type:String,default:''},
|
|
7
|
+
work:{type:String,default:''},
|
|
8
|
+
watchers:{type:Array,default:[]},//people responsible for the overall flow
|
|
9
|
+
workheaders:{type:Array,default:[]},
|
|
10
|
+
flow:{type:Array,default:[]}
|
|
11
|
+
}
|
|
12
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const { Schema } = require('mongoose')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
ActiveTask:new Schema(...require('./schemas/activetask.js')),
|
|
5
|
+
FinishedTask:new Schema(...require('./schemas/finishedtask.js')),
|
|
6
|
+
WorkFlow:new Schema(...require('./schemas/workflow.js')),
|
|
7
|
+
Todo:new Schema(...require('./schemas/todo.js'))
|
|
8
|
+
}
|
package/core-models.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
let addressCore={
|
|
2
|
+
street: { type: String, default: '' },
|
|
3
|
+
unit: { type: String, default: '' },
|
|
4
|
+
city: { type: String, default: '' },
|
|
5
|
+
state: { type: String, default: '' },
|
|
6
|
+
zip: { type: String, default: '' }
|
|
7
|
+
}
|
|
8
|
+
let contactCore={
|
|
9
|
+
contact:{type:String,default:''}, //
|
|
10
|
+
phone:{type:String,default:''},
|
|
11
|
+
email:{type:String,default:''}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
aaddress:addressCore,
|
|
16
|
+
acontact:contactCore
|
|
17
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheme Index
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
Company:require('./Company/company.js'),
|
|
6
|
+
Households:require('./HouseHolds/households.js'),
|
|
7
|
+
Systems:require('./Systems/systems.js'),
|
|
8
|
+
Logs: require('./Logs/logs.js'),
|
|
9
|
+
Replacement: require('./Replacement/replacement.js'),
|
|
10
|
+
Service: require('./Service/service.js'),
|
|
11
|
+
Memberships:require('./Memberships/memberships.js'),
|
|
12
|
+
Document: require('./Document/document.js'),
|
|
13
|
+
TaskManager: require('./TaskManager/taskmanager.js'),
|
|
14
|
+
Pricing:require('./Pricing/pricing.js')
|
|
15
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* empID - {unique:true,name:"empID"}
|
|
5
|
+
*/
|
|
6
|
+
const Employee = new Schema({
|
|
7
|
+
empID: { type: String, default: '' },
|
|
8
|
+
coid: { type: String, default: '' },
|
|
9
|
+
|
|
10
|
+
fName: { type: String, default: '' },
|
|
11
|
+
lName: { type: String, default: '' },
|
|
12
|
+
|
|
13
|
+
dept: {type:String,default:''},
|
|
14
|
+
title: { type: String, default: '' },
|
|
15
|
+
type: { type: String, default: '' },
|
|
16
|
+
repTo: { type: String, default: '' }, // empID
|
|
17
|
+
jobDesc: { type: String, default: '' },
|
|
18
|
+
joined: { type: Date, default: '' },
|
|
19
|
+
bday: { type: Date, default: '' },
|
|
20
|
+
skills: { type: String, default: '' },
|
|
21
|
+
interest: { type: String, default: '' },
|
|
22
|
+
tasks: { type: Array,default:[] },
|
|
23
|
+
active:{ type: Boolean,default:true},
|
|
24
|
+
goals: { type: Array,default:[] },
|
|
25
|
+
picture: { type: String, default: '' },
|
|
26
|
+
}, {
|
|
27
|
+
toJSON: { virtuals: true },
|
|
28
|
+
toObject: { virtuals: true },
|
|
29
|
+
strictQuery: false,
|
|
30
|
+
timestamps: true
|
|
31
|
+
})
|
|
32
|
+
Employee.virtual('Account',{
|
|
33
|
+
ref:'Account',
|
|
34
|
+
localField:'empID',
|
|
35
|
+
foreignField:'empID'
|
|
36
|
+
})
|
|
37
|
+
Employee.virtual('Device',{
|
|
38
|
+
ref:'Device',
|
|
39
|
+
localField:'empID',
|
|
40
|
+
foreignField:'empID'
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* devID - {unique:true,name:"devID"}
|
|
45
|
+
*/
|
|
46
|
+
const Device = new Schema({
|
|
47
|
+
devID: { type: String, default: '' },
|
|
48
|
+
empID: { type: String, default: '' },
|
|
49
|
+
name: { type: String, default: '' },
|
|
50
|
+
type: { type: String, default: '' },
|
|
51
|
+
manf: { type: String, default: '' },
|
|
52
|
+
model: { type: String, default: '' },
|
|
53
|
+
serial: { type: String, default: '' },
|
|
54
|
+
simRef: { type: String, default: '' },
|
|
55
|
+
imei:{type:String,default:''},
|
|
56
|
+
userName: { type: String, default: '' },
|
|
57
|
+
userLock: { type: String, default: '' },
|
|
58
|
+
lock: { type: String, default: '' },
|
|
59
|
+
purchasePrice: { type: Number, default: 0 },
|
|
60
|
+
purchaseDate: { type: Date, default: '' },
|
|
61
|
+
upgradeDate: { type: Date, default: '' },
|
|
62
|
+
notes:{type:String,default:''}
|
|
63
|
+
},{
|
|
64
|
+
toJSON: { virtuals: true },
|
|
65
|
+
toObject: { virtuals: true },
|
|
66
|
+
strictQuery: false
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* iccid - {unique:true,name:"iccid"}
|
|
71
|
+
* number - { unique: true, sparse:true, name:"number" }
|
|
72
|
+
*/
|
|
73
|
+
const SIM = new Schema({
|
|
74
|
+
iccid: { type: String, default: '' },
|
|
75
|
+
name: {type: String, default:''},
|
|
76
|
+
number: {type:String,default:undefined},//is undefined to keep unique even if it is not filled in yet
|
|
77
|
+
group: {type:String,default:''},
|
|
78
|
+
active: {type:Boolean,default:true},
|
|
79
|
+
type: {type:String,default:''}
|
|
80
|
+
});
|
|
81
|
+
/** Employees
|
|
82
|
+
* To handle all employees from company OR group of companies. The coid can be used
|
|
83
|
+
* to describe the company. Company ids are matching the ids in Jonas.
|
|
84
|
+
*/
|
|
85
|
+
/** Devices
|
|
86
|
+
* Used for employee devices. They will all carry the assiciated ID. If they do not
|
|
87
|
+
* belong to any one user, the devices are placed.
|
|
88
|
+
*
|
|
89
|
+
* there is no association to the company accept through the empID. May be needed
|
|
90
|
+
* to create admin accounts to pool un used devices to that company.
|
|
91
|
+
*/
|
|
92
|
+
module.exports = {
|
|
93
|
+
Employee: Employee,
|
|
94
|
+
Device:Device,
|
|
95
|
+
SIM:SIM,
|
|
96
|
+
Account: new Schema({
|
|
97
|
+
empID: { type: String, default: '' },
|
|
98
|
+
type: { type: String, default: '' },
|
|
99
|
+
user: { type: String, default: '' }, // email || username
|
|
100
|
+
pswrd: { type: String, default: '' },
|
|
101
|
+
twoFactors: [{ type: String, contact: String }],
|
|
102
|
+
devices: { type: Array, default: [] },
|
|
103
|
+
active: { type: Boolean, default: true },
|
|
104
|
+
admin: { type: Boolean, default: false },
|
|
105
|
+
resetPswrd: { type: Date, default: '' }
|
|
106
|
+
})
|
|
107
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
const documentCore = {
|
|
4
|
+
id: { type: String, default: '' },
|
|
5
|
+
cat: { type: String, default: '' },
|
|
6
|
+
html: { type: Array, default: [] },
|
|
7
|
+
css: { type: Array, default: [] },
|
|
8
|
+
filename: { type: String, default: '' },
|
|
9
|
+
type: { type: String, default: '' },
|
|
10
|
+
contentType: { type: String, default: 'application/pdf' }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var serviceSchema = new Schema({
|
|
14
|
+
...documentCore
|
|
15
|
+
}, {
|
|
16
|
+
strict: false
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
var replacementSchema = new Schema({
|
|
20
|
+
...documentCore
|
|
21
|
+
}, {
|
|
22
|
+
strict: false
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
Service: serviceSchema,
|
|
29
|
+
Replacement: replacementSchema
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
/*
|
|
3
|
+
bids={
|
|
4
|
+
comp,<String>
|
|
5
|
+
cat,<string>
|
|
6
|
+
saletype,<string>
|
|
7
|
+
|
|
8
|
+
finance:<number>
|
|
9
|
+
bookprice:<boolean>
|
|
10
|
+
|
|
11
|
+
amount,<number>
|
|
12
|
+
status,<string>
|
|
13
|
+
sold <boolean>
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
*/
|
|
17
|
+
module.exports={
|
|
18
|
+
Project:new Schema({
|
|
19
|
+
custcode:{type:String, default:''},
|
|
20
|
+
street:{type:String,default:''},
|
|
21
|
+
city:{type:String,default:''},
|
|
22
|
+
lead:{type:Date, default:''},
|
|
23
|
+
bids:{type:Array, default:[]},
|
|
24
|
+
projects:{type:Array, default:[]},
|
|
25
|
+
estimator:{type:String, default:''}
|
|
26
|
+
},{strict:false}),
|
|
27
|
+
Service:new Schema({},{strict:false}),
|
|
28
|
+
Bid:new Schema({},{strict:false}),
|
|
29
|
+
Interaction:new Schema({
|
|
30
|
+
hhid:{type:String,default:''},
|
|
31
|
+
custid:{type:String,default:''},
|
|
32
|
+
workrefs:{type:Array,default:[]},//array of objects to describe workref
|
|
33
|
+
empID:{type:String,default:''},
|
|
34
|
+
date:{type:String,default:Date.now},
|
|
35
|
+
type:{type:String,default:''},
|
|
36
|
+
info:{type:Object,default:{}}
|
|
37
|
+
}),
|
|
38
|
+
SystemCheck:new Schema({},{strict:false})
|
|
39
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
Client: new Schema({
|
|
5
|
+
coid:{type:String,default:''},
|
|
6
|
+
custCode : {type:String,default:''},
|
|
7
|
+
custName:{type:String,default:''},
|
|
8
|
+
fname: { type: String, default: '' },
|
|
9
|
+
lname: { type: String, default: '' },
|
|
10
|
+
contactName:{type:String,default:''},
|
|
11
|
+
phone: { type: String, default: '' }, // id
|
|
12
|
+
phone2: { type: String, default: '' },
|
|
13
|
+
email: { type: String, default: '' },
|
|
14
|
+
|
|
15
|
+
createDate: { type: String, default: '' },
|
|
16
|
+
lastTransaction: { type: String, default: '' },
|
|
17
|
+
salesRep: { type: String, default: '' }
|
|
18
|
+
}),
|
|
19
|
+
Home:new Schema({
|
|
20
|
+
hhid:{type:String,default:''},
|
|
21
|
+
street:{type:String,default:''},
|
|
22
|
+
unit:{type:String,default:''},
|
|
23
|
+
city:{type:String,default:''},
|
|
24
|
+
state:{type:String,default:''},
|
|
25
|
+
zip:{type:String,default:''},
|
|
26
|
+
|
|
27
|
+
lat:{type:Number,default:''},
|
|
28
|
+
lon:{type:Number,default:''},
|
|
29
|
+
|
|
30
|
+
custid:{type:String,default:''},
|
|
31
|
+
|
|
32
|
+
utilities:{type:Object,default:{
|
|
33
|
+
eleccomp:'',
|
|
34
|
+
gascomp:''
|
|
35
|
+
}},
|
|
36
|
+
activeProjects:{type:Array,default:[]},
|
|
37
|
+
activeService:{type:Array,default:[]},
|
|
38
|
+
measurements:{type:Object,default:{}},
|
|
39
|
+
features:{
|
|
40
|
+
elecService:{
|
|
41
|
+
panel:{type:String,default:''},
|
|
42
|
+
serviceSize:{type:String,default:''},
|
|
43
|
+
wireType:{type:String,default:''},
|
|
44
|
+
provider:{type:String,default:''}
|
|
45
|
+
},
|
|
46
|
+
gasService:{
|
|
47
|
+
provider:{type:String,default:''},
|
|
48
|
+
type:{type:String,default:''}
|
|
49
|
+
},
|
|
50
|
+
roof:{
|
|
51
|
+
roofTint:{type:String,default:''},
|
|
52
|
+
roofMake:{type:String,default:''},
|
|
53
|
+
pitch:{type:String,default:''},
|
|
54
|
+
gutters:{
|
|
55
|
+
material:{type:String,default:''},
|
|
56
|
+
feet:{type:Number,default:0}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
waterheater:{
|
|
60
|
+
capacity:{type:Number,default:0},
|
|
61
|
+
btus:{type:Number,default:0},
|
|
62
|
+
type:{type:String,default:''},
|
|
63
|
+
condition:{type:Number,default:''}
|
|
64
|
+
},
|
|
65
|
+
foundation:{type:String,default:''},
|
|
66
|
+
frontFace:{type:String,default:''},
|
|
67
|
+
buildYear:{type:Number,default:0},
|
|
68
|
+
sqft:{type:Number,default:0},
|
|
69
|
+
floors:{type:Number,default:0},
|
|
70
|
+
baths:{type:Number,default:0},
|
|
71
|
+
rooms:{type:Number,default:0}
|
|
72
|
+
},
|
|
73
|
+
spaces:{type:Array,default:[]},
|
|
74
|
+
systems:{type:Array,default:[]},
|
|
75
|
+
froot:{type:String,default:''}
|
|
76
|
+
}),
|
|
77
|
+
System:new Schema({
|
|
78
|
+
hhid:{type:String,default:''},
|
|
79
|
+
sysid:{type:String,default:''},
|
|
80
|
+
type:{type:String,default:''},
|
|
81
|
+
name:{type:String,default:''},
|
|
82
|
+
descr:{type:String,default:''},
|
|
83
|
+
areaserved:{type:String,default:''}
|
|
84
|
+
}),
|
|
85
|
+
ServiceItem:new Schema({
|
|
86
|
+
sysid:{type:String,default:''},
|
|
87
|
+
quantity:{type:Number,default:1},
|
|
88
|
+
type:{type:String,default:''},
|
|
89
|
+
name:{type:String,default:''},
|
|
90
|
+
location:{type:String,default:''},
|
|
91
|
+
notes:{type:String,default:''}
|
|
92
|
+
}),
|
|
93
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const { Schema } = require('mongoose');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var logSchema = new Schema({
|
|
5
|
+
process:{type:String,default:''},
|
|
6
|
+
server:{type:String,default:''},
|
|
7
|
+
timein:{type:Date,default:null},
|
|
8
|
+
timeout:{type:Date,default:null},
|
|
9
|
+
logs:{type:Array,default:[]}
|
|
10
|
+
},{strict:false});
|
|
11
|
+
|
|
12
|
+
module.exports={
|
|
13
|
+
Server:logSchema
|
|
14
|
+
}
|