vhp-mongo-models 1.3.3 → 1.3.5
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/schemas/device.js +5 -3
- package/Company/schemas/employee.js +12 -9
- package/HouseHolds/schemas/client.js +1 -1
- package/HouseHolds/schemas/home.js +1 -0
- package/Service/schemas/completeticket.js +2 -2
- package/Service/schemas/subs/final.js +1 -0
- package/Systems/schemas/subs/userAppSettings.js +52 -0
- package/Systems/schemas/userprofile.js +3 -4
- package/Systems/schemas/usersetting.js +21 -5
- package/package.json +1 -1
- package/old/CompanySchemes.js +0 -107
- package/old/DocumentSchemes.js +0 -30
- package/old/HistorySchemes.js +0 -39
- package/old/HouseHoldSchemes.js +0 -93
- package/old/LogSchemes.js +0 -14
- package/old/MembershipsSchemes.js +0 -48
- package/old/PricingSchemes.js +0 -15
- package/old/ReplacementSchemes.js +0 -194
- package/old/ReportingSchemes.js +0 -5
- package/old/ServiceItems.js +0 -21
- package/old/ServiceSchemes.js +0 -35
- package/old/SpiffSchemes.js +0 -49
- package/old/SystemsSchemes.js +0 -71
- package/old/WorkFlowSchemes.js +0 -69
- package/old/spares.js +0 -22
|
@@ -8,16 +8,18 @@ module.exports=[
|
|
|
8
8
|
{
|
|
9
9
|
devID: { type: String, default: '' },
|
|
10
10
|
empID: { type: String, default: '' },
|
|
11
|
-
name: { type: String, default: '' },
|
|
11
|
+
name: { type: String, default: '' }, //get ride of redundant
|
|
12
12
|
type: { type: String, default: '' },
|
|
13
13
|
manf: { type: String, default: '' },
|
|
14
14
|
model: { type: String, default: '' },
|
|
15
|
-
group: {type:String,default:''},
|
|
15
|
+
group: {type:String,default:''}, //tags as an array of custom whatever
|
|
16
16
|
serial: { type: String, default: '' },
|
|
17
|
-
|
|
17
|
+
line: { type:String, default:'' },
|
|
18
|
+
simRef: { type: String, default: '' }, //relace with line
|
|
18
19
|
imei:{type:String,default:''},
|
|
19
20
|
userName: { type: String, default: '' },
|
|
20
21
|
userLock: { type: String, default: '' },
|
|
22
|
+
active:{type:Boolean,default:true},
|
|
21
23
|
lock: { type: String, default: '' },
|
|
22
24
|
purchasePrice: { type: Number, default: 0 },
|
|
23
25
|
purchaseDate: { type: Date, default: '' },
|
|
@@ -7,24 +7,27 @@
|
|
|
7
7
|
module.exports=[
|
|
8
8
|
{
|
|
9
9
|
empID: { type: String, default: '' },
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
active:{ type: Boolean,default:true},
|
|
11
|
+
|
|
12
12
|
fName: { type: String, default: '' },
|
|
13
13
|
lName: { type: String, default: '' },
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
coid: { type: String, default: '' },
|
|
15
16
|
dept: {type:String,default:''},
|
|
16
|
-
title: { type: String, default: '' },
|
|
17
|
-
type: { type: String, default: '' },
|
|
18
17
|
repTo: { type: String, default: '' }, // empID
|
|
18
|
+
title: { type: String, default: '' },
|
|
19
|
+
type: { type: String, default: '' }, //remove
|
|
19
20
|
jobDesc: { type: String, default: '' },
|
|
20
|
-
|
|
21
|
-
bday: { type: Date, default: '' },
|
|
21
|
+
|
|
22
22
|
skills: { type: String, default: '' },
|
|
23
|
-
interest: { type: String, default: '' },
|
|
24
23
|
tasks: { type: Array,default:[] },
|
|
25
|
-
active:{ type: Boolean,default:true},
|
|
26
24
|
goals: { type: Array,default:[] },
|
|
25
|
+
|
|
26
|
+
joined: { type: Date, default: '' },
|
|
27
|
+
bday: { type: Date, default: '' },
|
|
28
|
+
interest: { type: String, default: '' },
|
|
27
29
|
picture: { type: String, default: '' },
|
|
30
|
+
contact: { type: String, default:'' }
|
|
28
31
|
}, {
|
|
29
32
|
toJSON: { virtuals: true },
|
|
30
33
|
toObject: { virtuals: true },
|
|
@@ -16,7 +16,7 @@ module.exports = [
|
|
|
16
16
|
phone2: { type: String, default: '' },
|
|
17
17
|
email: { type: String, default: '' },
|
|
18
18
|
linked: { type: Boolean, default:true},
|
|
19
|
-
|
|
19
|
+
billto: {type:String, default:''}, //holding the hhid
|
|
20
20
|
createDate: { type: String, default: '' },
|
|
21
21
|
lastTransaction: { type: String, default: '' },
|
|
22
22
|
salesRep: { type: String, default: '' }
|
|
@@ -25,8 +25,8 @@ module.exports = [
|
|
|
25
25
|
salesrep:{type:String,default:''},
|
|
26
26
|
sitems: { type: Array, default: [] },
|
|
27
27
|
wo: wo,
|
|
28
|
-
todo:{type:Object, default: {}},
|
|
29
|
-
office: { type:
|
|
28
|
+
todo:{type:Object, default: {}}, //remove
|
|
29
|
+
office: { type: Array, default: [] },
|
|
30
30
|
logs:{type:Array,default:[]}
|
|
31
31
|
}
|
|
32
32
|
]
|
|
@@ -21,6 +21,7 @@ let ticketFinal = new Schema({
|
|
|
21
21
|
invoice:ticketInvoice,
|
|
22
22
|
signature:{type:String,default:''},
|
|
23
23
|
emailed:{type:Boolean,default:false},
|
|
24
|
+
officeSubmit:{type:String,default:''},
|
|
24
25
|
paymentMethod:{type:String,default:''},
|
|
25
26
|
returnVisit:{type:String,default:false},
|
|
26
27
|
returnNotes:{type:String,default:''},
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
const appsetup = {
|
|
3
|
+
access:{type:Array,default:[]}, //list of available apps
|
|
4
|
+
apps:{type:Object,default:{}}, //object of available views
|
|
5
|
+
|
|
6
|
+
settings:{type:Object,default:{
|
|
7
|
+
system:{
|
|
8
|
+
defaultApp:'VHPportal',
|
|
9
|
+
defaultView:'',
|
|
10
|
+
canCreateUsers:false,
|
|
11
|
+
canEditUsers:false,
|
|
12
|
+
canRemoveUsers:false,
|
|
13
|
+
enableNotifications:false,
|
|
14
|
+
},
|
|
15
|
+
company:{
|
|
16
|
+
companies:[],
|
|
17
|
+
departments:[],
|
|
18
|
+
canCreateEmployee:false,
|
|
19
|
+
canEditEmployee:false,
|
|
20
|
+
canEditDevices:false,
|
|
21
|
+
canEditAccounts:false,
|
|
22
|
+
canEditContacts:false,
|
|
23
|
+
canRemoveEmployee:false
|
|
24
|
+
},
|
|
25
|
+
households:{
|
|
26
|
+
canCreate:false,
|
|
27
|
+
canEdit:false,
|
|
28
|
+
canRemove:false,
|
|
29
|
+
canEditContacts:false,
|
|
30
|
+
canTakeLeads:false,
|
|
31
|
+
canTransferHomes:false,
|
|
32
|
+
canChangeClientID:false,
|
|
33
|
+
canContactClient:false
|
|
34
|
+
},
|
|
35
|
+
projects:{
|
|
36
|
+
canCreate:false,
|
|
37
|
+
canEdit:false,
|
|
38
|
+
canRemove:false,
|
|
39
|
+
canApprove:false,
|
|
40
|
+
canQuote:false,
|
|
41
|
+
canPayCommission:false
|
|
42
|
+
},
|
|
43
|
+
service:{
|
|
44
|
+
isTech:false,
|
|
45
|
+
canRemove:false,
|
|
46
|
+
canInvoice:false,
|
|
47
|
+
canEditServiceItems:false
|
|
48
|
+
}
|
|
49
|
+
}}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = appsetup
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
const settings = require('./subs/userAppSettings.js');
|
|
2
|
+
|
|
1
3
|
module.exports = [
|
|
2
4
|
{
|
|
3
5
|
type:{type:String,default:''},
|
|
4
|
-
|
|
5
|
-
departments:{type:Array,default:[]},
|
|
6
|
-
apps:{type:Object,default:{}},
|
|
7
|
-
access:{type:Array,default:[]}
|
|
6
|
+
...settings
|
|
8
7
|
},
|
|
9
8
|
{
|
|
10
9
|
//toJSON: { virtuals: true },
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
const userSetup = require('./subs/userAppSettings.js')
|
|
2
3
|
/**
|
|
3
4
|
* User settings are the base for a user. Types can be included to pre set the settings based on a profile. After creation
|
|
4
5
|
* the settings can be changed, but reset to the type at any time.
|
|
@@ -8,12 +9,27 @@ module.exports=[
|
|
|
8
9
|
{
|
|
9
10
|
empID:{type:String,default:''},
|
|
10
11
|
user:{type:String,defaullt:''},
|
|
11
|
-
companies:{type:Array,default:[]},
|
|
12
|
-
profile:{type:String,default:''},//optional to connect to a UserProfile
|
|
13
|
-
apps:{type:Object,default:{}},
|
|
14
12
|
admin:{type:Boolean,default:false},
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
profile:{type:String,default:''},//optional to connect to a UserProfile
|
|
14
|
+
|
|
15
|
+
...userSetup, //holds all lists and switchs. can be overwritten by profile
|
|
16
|
+
|
|
17
|
+
preferences:{type:Object,default:{//to hold items "tweakable" from the portal
|
|
18
|
+
system:{
|
|
19
|
+
darkMode:false,
|
|
20
|
+
defaultApp:'',
|
|
21
|
+
defaultView:''
|
|
22
|
+
},
|
|
23
|
+
company:{
|
|
24
|
+
companies:[],
|
|
25
|
+
departments:[]
|
|
26
|
+
},
|
|
27
|
+
home:{
|
|
28
|
+
favorites:[],
|
|
29
|
+
links:[],
|
|
30
|
+
carousel:[]
|
|
31
|
+
}
|
|
32
|
+
}}
|
|
17
33
|
},
|
|
18
34
|
{
|
|
19
35
|
//toJSON: { virtuals: true },
|
package/package.json
CHANGED
package/old/CompanySchemes.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
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
|
-
}
|
package/old/DocumentSchemes.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
}
|
package/old/HistorySchemes.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
}
|
package/old/HouseHoldSchemes.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
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
|
-
}
|
package/old/LogSchemes.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const { Schema } = require('mongoose');
|
|
2
|
-
|
|
3
|
-
/**PVmaints
|
|
4
|
-
*
|
|
5
|
-
* index
|
|
6
|
-
* - contractNum - {unique:true,name:"contractNum"}
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
module.exports={
|
|
11
|
-
PVmaint: new Schema({
|
|
12
|
-
jobref: { type: String, default: '' },
|
|
13
|
-
|
|
14
|
-
contractNum: { type: String, default: '' },
|
|
15
|
-
custCode: { type: String, default: '' },
|
|
16
|
-
custName: { type: String, default: '' },
|
|
17
|
-
|
|
18
|
-
status: { type: String, default: 'A' },
|
|
19
|
-
renewed: { type: Boolean, default: false },
|
|
20
|
-
|
|
21
|
-
installers: { type: Array, default: [] },
|
|
22
|
-
|
|
23
|
-
street: { type: String, default: '' },
|
|
24
|
-
unit: { type: String, default: '' },
|
|
25
|
-
state: { type: String, default: '' },
|
|
26
|
-
zip: { type: String, default: '' },
|
|
27
|
-
|
|
28
|
-
phone: { type: String, default: '' },
|
|
29
|
-
email: { type: String, default: '' },
|
|
30
|
-
|
|
31
|
-
notes: { type: String, default: '' },
|
|
32
|
-
|
|
33
|
-
visits: { type: Array, default: [] },
|
|
34
|
-
|
|
35
|
-
coolingdate: { type: Date, default: '' },
|
|
36
|
-
coolingscheduled: { type: Boolean, default: false },
|
|
37
|
-
heatingdate: { type: Date, default: '' },
|
|
38
|
-
heatingscheduled: { type: Boolean, default: false },
|
|
39
|
-
|
|
40
|
-
//move to review section
|
|
41
|
-
coolingcheck: { type: Date, default: '' },
|
|
42
|
-
coolingphotos: { type: Boolean, default: false },
|
|
43
|
-
|
|
44
|
-
heatingphotos: { type: Boolean, default: false },
|
|
45
|
-
heatingcheck: { type: Date, default: '' }
|
|
46
|
-
}),
|
|
47
|
-
RewardMem:new Schema({},{strict:false})
|
|
48
|
-
}
|
package/old/PricingSchemes.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const { Schema } = require('mongoose');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Geared toward Price Keys
|
|
5
|
-
* Do we need something more general?
|
|
6
|
-
*/
|
|
7
|
-
var pricingCore = {
|
|
8
|
-
version: { type: String, default: '' },
|
|
9
|
-
date: { type: Date, default: Date.now },
|
|
10
|
-
pkid: { type: String, default: '' }
|
|
11
|
-
}
|
|
12
|
-
module.exports = {
|
|
13
|
-
Pricing350: new Schema({ ...pricingCore }, { strict: false }),
|
|
14
|
-
PricingBEE: new Schema({ ...pricingCore }, { strict: false }),
|
|
15
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
const { Schema } = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const { aaddress, acontact } = require('./core-models.js');
|
|
4
|
-
|
|
5
|
-
var projectCoreBEE = {
|
|
6
|
-
id: { type: String, default: '' },
|
|
7
|
-
name: { type: String, default: '' },
|
|
8
|
-
|
|
9
|
-
jobnum: { type: String, default: '' },
|
|
10
|
-
|
|
11
|
-
custid: { type: String, default: '' },
|
|
12
|
-
street: { type: String, default: '' },
|
|
13
|
-
unit: { type: String, default: '' },
|
|
14
|
-
city: { type: String, default: '' },
|
|
15
|
-
state: { type: String, default: '' },
|
|
16
|
-
zip: { type: String, default: '' },
|
|
17
|
-
|
|
18
|
-
customer: {
|
|
19
|
-
id: { type: String, default: '' },
|
|
20
|
-
name: { type: String, default: '' }, // do we need to make this a virtual instead?
|
|
21
|
-
fname: { type: String, default: '' },
|
|
22
|
-
lname: { type: String, default: '' },
|
|
23
|
-
street: { type: String, default: '' },
|
|
24
|
-
unit: { type: String, default: '' },
|
|
25
|
-
city: { type: String, default: '' },
|
|
26
|
-
state: { type: String, default: '' },
|
|
27
|
-
zip: { type: String, default: '' },
|
|
28
|
-
strdate: { type: String, default: '' },
|
|
29
|
-
lastsale: { type: String, default: '' },
|
|
30
|
-
type: { type: String, default: '' },
|
|
31
|
-
phone: { type: String, default: '' },
|
|
32
|
-
phone2: { type: String, default: '' },
|
|
33
|
-
email: { type: String, default: '' },
|
|
34
|
-
rep: { type: String, default: '' } // we have this info, but we never fill this
|
|
35
|
-
},
|
|
36
|
-
estimator: { type: String, default: '' },
|
|
37
|
-
installers: { type: Array, default: [] },
|
|
38
|
-
|
|
39
|
-
dept: { type: String, default: '' },
|
|
40
|
-
cat: { type: String, default: '' },
|
|
41
|
-
|
|
42
|
-
stage: { type: String, default: 'quote' },
|
|
43
|
-
status: { type: String, default: 'active' },
|
|
44
|
-
|
|
45
|
-
sold: { type: Boolean, default: false },
|
|
46
|
-
|
|
47
|
-
opendate: { type: Date, default: Date.now() },
|
|
48
|
-
lastdate: { type: Date, default: Date.now() },
|
|
49
|
-
scheddate: { type: Date, default: '' },
|
|
50
|
-
closedate: { type: Date, default: '' },
|
|
51
|
-
|
|
52
|
-
datelog: { type: Array, default: [] },
|
|
53
|
-
|
|
54
|
-
info: { type: Object, default: {} },
|
|
55
|
-
|
|
56
|
-
trackid: { type: String, default: null },//holds doc ids for tracking
|
|
57
|
-
|
|
58
|
-
froot: { type: String, default: '' }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/*
|
|
62
|
-
Am not going to have an index in case there is a need for two
|
|
63
|
-
items with the same job ref
|
|
64
|
-
*/
|
|
65
|
-
/** Projects Schema
|
|
66
|
-
*
|
|
67
|
-
* index
|
|
68
|
-
* - id - {unique:true,name:"id"}
|
|
69
|
-
*/
|
|
70
|
-
/** Tracking Scheme
|
|
71
|
-
*
|
|
72
|
-
* index
|
|
73
|
-
* - id - {unique:true,name:"id"}
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
const projectCore = {
|
|
77
|
-
id: { type: String, default: '' },
|
|
78
|
-
name: { type: String, default: '' },
|
|
79
|
-
|
|
80
|
-
jobnum: { type: String, default: '' },
|
|
81
|
-
|
|
82
|
-
hhid: { type: String, default: '' },
|
|
83
|
-
clientfirst: { type: String, default: '' },
|
|
84
|
-
clientlast: { type: String, default: '' },
|
|
85
|
-
...aaddress,
|
|
86
|
-
...acontact,
|
|
87
|
-
|
|
88
|
-
estimator: { type: String, default: '' },
|
|
89
|
-
techs: { type: Array, default: [] },
|
|
90
|
-
|
|
91
|
-
dept: { type: String, default: '' },
|
|
92
|
-
cat: { type: String, default: '' },
|
|
93
|
-
|
|
94
|
-
stage: { type: String, default: 'quote' },
|
|
95
|
-
status: { type: String, default: 'active' },
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
opendate: { type: Date, default: Date.now() },
|
|
99
|
-
lastdate: { type: Date, default: Date.now() },
|
|
100
|
-
solddate: { type: Date, default: '' },
|
|
101
|
-
scheddate: { type: Date, default: '' }, //get rid of eventually?
|
|
102
|
-
closedate: { type: Date, default: '' },
|
|
103
|
-
|
|
104
|
-
datelog: { type: Array, default: [] },
|
|
105
|
-
|
|
106
|
-
info: { type: Object, default: {} },
|
|
107
|
-
contracts:{type:Array, default:[]},
|
|
108
|
-
|
|
109
|
-
lead:{
|
|
110
|
-
type:Object,
|
|
111
|
-
default:{
|
|
112
|
-
apptdate:{type:Date,default:''},
|
|
113
|
-
prstdate:{type:Date,default:''},
|
|
114
|
-
time:{type:String,default:''},
|
|
115
|
-
carryover:{type:Boolean,default:false},
|
|
116
|
-
prstvia:{type:String,default:''},
|
|
117
|
-
rewards:{type:Boolean,default:false},
|
|
118
|
-
source:{type:String,default:''},
|
|
119
|
-
generator:{type:String,default:''},
|
|
120
|
-
paid:{type:Date,default:''}
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
trackid: { type: String, default: null },//holds doc id for tracking
|
|
124
|
-
refs:{type:Array, default:[]}, //remove?
|
|
125
|
-
wos:{type:Array, default:[]},
|
|
126
|
-
|
|
127
|
-
froot: { type: String, default: '' }
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
module.exports = {
|
|
131
|
-
Project: new Schema({ ...projectCore }, {
|
|
132
|
-
toJSON: { virtuals: true },
|
|
133
|
-
toObject: { virtuals: true }
|
|
134
|
-
}),
|
|
135
|
-
Bid: new Schema({
|
|
136
|
-
projectId:{type:String,default:''}, //was ref
|
|
137
|
-
hhid:{type:String,default:''}, //new
|
|
138
|
-
dept:{type:String,default:''},
|
|
139
|
-
cat:{type:String,default:''},
|
|
140
|
-
type:{type:String,default:''},
|
|
141
|
-
bookprice:{type:Boolean,default:true},
|
|
142
|
-
amntTotal:{type:Number,default:0},
|
|
143
|
-
amntCust:{type:Number,default:0},
|
|
144
|
-
amntAmeren:{type:Number,default:0},
|
|
145
|
-
amntManf:{type:Number,default:0},
|
|
146
|
-
amntSpecial:{type:Number,default:0},
|
|
147
|
-
sold:{type:Date,default:''},
|
|
148
|
-
invoiced:{type:Date,default:''},
|
|
149
|
-
paid:{type:Date,default:''}
|
|
150
|
-
}),
|
|
151
|
-
ProjectsBEE: new Schema({ ...projectCore }, {
|
|
152
|
-
toJSON: { virtuals: true },
|
|
153
|
-
toObject: { virtuals: true },
|
|
154
|
-
}),
|
|
155
|
-
Tracking: new Schema({
|
|
156
|
-
id: { type: String, default: '' }, // unique, given to item being tracked
|
|
157
|
-
projectname: { type: String, default: '' },
|
|
158
|
-
ref: { type: Array, default: [] },
|
|
159
|
-
estimator: { type: String, default: '' },
|
|
160
|
-
|
|
161
|
-
cancelled: { type: Boolean, default: false },
|
|
162
|
-
carryover: { type: Boolean, default: false },
|
|
163
|
-
|
|
164
|
-
bids: { type: Array, default: [] }, // holds list of bid items
|
|
165
|
-
|
|
166
|
-
stage: { type: String, default: '' }, // quote || job || archived
|
|
167
|
-
status: { type: String, default: '' }, //
|
|
168
|
-
|
|
169
|
-
clientfirst: { type: String, default: '' }, // moved so this block is "Job Info" while above is "Contact Info"
|
|
170
|
-
clientlast: { type: String, default: '' },
|
|
171
|
-
...aaddress,
|
|
172
|
-
...acontact,
|
|
173
|
-
|
|
174
|
-
datelog: {
|
|
175
|
-
type: Array, default: [{
|
|
176
|
-
date: Date.now,
|
|
177
|
-
msg: 'Track Created'
|
|
178
|
-
}]
|
|
179
|
-
},//date of
|
|
180
|
-
apptdate: { type: Date, default: '' }, // was date
|
|
181
|
-
solddate: { type: Date, default: '' }, // should be there
|
|
182
|
-
|
|
183
|
-
time: { type: String, default: '' },
|
|
184
|
-
source: { type: String, default: '' },
|
|
185
|
-
generator: { type: String, default: '' }, // changed from "lead"; will need a cleanup!
|
|
186
|
-
//leadref: { type: String, default: '' }, // now directly part of generator
|
|
187
|
-
prstvia: { type: String, default: null },
|
|
188
|
-
prstdate: { type: Date, default: Date.now },
|
|
189
|
-
rewards: { type: Boolean, default: false },
|
|
190
|
-
|
|
191
|
-
amount: { type: Number, default: 0 } // how are we saving the breakdown now (Ameren, Manf, etc.)?
|
|
192
|
-
}),
|
|
193
|
-
Setting: new Schema({}, { strict: false })
|
|
194
|
-
}
|
package/old/ReportingSchemes.js
DELETED
package/old/ServiceItems.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
this schema needs addition properties, but
|
|
7
|
-
its here for testing. The current structure
|
|
8
|
-
is more of suggestions
|
|
9
|
-
*/
|
|
10
|
-
var sichecklist = {
|
|
11
|
-
custcode: { type: String, default: '' },
|
|
12
|
-
ref: { type: String, default: '' },
|
|
13
|
-
date: { type: Date, default: '' },
|
|
14
|
-
|
|
15
|
-
sitems: { type: Array, default: [] },
|
|
16
|
-
checkinfo: { type: String, default: '' }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = {
|
|
20
|
-
SIchecklist: new Schema({ ...sichecklist })
|
|
21
|
-
}
|
package/old/ServiceSchemes.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const { Schema } = require('mongoose');
|
|
2
|
-
|
|
3
|
-
const {aaddress}=require('./core-models.js');
|
|
4
|
-
|
|
5
|
-
var ticketCore = {
|
|
6
|
-
id: { type: String, default: '' },
|
|
7
|
-
ref: { type: Object, default: {} },
|
|
8
|
-
status: { type: String, default: 'active' }, // active, archived, invoice,
|
|
9
|
-
techs: { type: Array, default: [] },
|
|
10
|
-
custid: {type:String, default:''},
|
|
11
|
-
cat:{type:String,default:''},
|
|
12
|
-
dept:{type:String,default:''},
|
|
13
|
-
hhid:{type:String,default:''},
|
|
14
|
-
|
|
15
|
-
...aaddress,
|
|
16
|
-
documents: { type: Array, default: [] },
|
|
17
|
-
|
|
18
|
-
checks: { type: Array, default: [] },
|
|
19
|
-
conform: { type: Object, default: {} },
|
|
20
|
-
contract: { type: Object, default: {} },
|
|
21
|
-
final: { type: Object, default: {} },
|
|
22
|
-
repairs: { type: Array, default: [] },
|
|
23
|
-
salesrep:{type:String,default:''},
|
|
24
|
-
sitems: { type: Array, default: [] },
|
|
25
|
-
wo: { type: Object, default: {} },
|
|
26
|
-
todo:{type:Object, default: {}},
|
|
27
|
-
office: { type: Object, default: {} },
|
|
28
|
-
logs:{type:Array,default:[]}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
module.exports = {
|
|
32
|
-
ActiveTicket: new Schema({...ticketCore},{}),
|
|
33
|
-
CompleteTicket: new Schema({...ticketCore},{}),
|
|
34
|
-
ClosedTicket: new Schema({...ticketCore},{})
|
|
35
|
-
}
|
package/old/SpiffSchemes.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const { Schema } = require('mongoose');
|
|
2
|
-
|
|
3
|
-
var Spiff = new Schema({
|
|
4
|
-
FormID: { type: String, default: '' },
|
|
5
|
-
TechID: { type: String, default: '' },
|
|
6
|
-
TechLName: { type: String, default: '' },
|
|
7
|
-
TechFName: { type: String, default: '' },
|
|
8
|
-
Date: { type: Date, default: '' },
|
|
9
|
-
WO: { type: String, default: '' },
|
|
10
|
-
Address: { type: String, default: '' },
|
|
11
|
-
CustLName: { type: String, default: '' },
|
|
12
|
-
CustFName: { type: String, default: '' },
|
|
13
|
-
ReferTo: { type: String, default: '' },
|
|
14
|
-
SpiffFor: { type: String, default: '' },
|
|
15
|
-
status: { type: String, default: '' },
|
|
16
|
-
paid: { type: String, default: '' },
|
|
17
|
-
comments: { type: Array, default: [] },
|
|
18
|
-
closedate: { type: Date, default: '' },
|
|
19
|
-
reportmonth: { type: String, default: '' },
|
|
20
|
-
reportid: { type: String, default: '' },
|
|
21
|
-
lastdate: { type: Date, default: '' },
|
|
22
|
-
editor: { type: Array, defualt: [] },
|
|
23
|
-
reportStatus: { type: String, deafult: '' }
|
|
24
|
-
}, {});
|
|
25
|
-
|
|
26
|
-
var SpiffReport = new Schema({
|
|
27
|
-
id: { type: String, default: '' },
|
|
28
|
-
cleaned: { type: Boolean, default: false },
|
|
29
|
-
comInfo: {
|
|
30
|
-
type: Object, default: {
|
|
31
|
-
lost: 0,
|
|
32
|
-
approved: 0,
|
|
33
|
-
commission: 0,
|
|
34
|
-
open: 0,
|
|
35
|
-
submitted: 0
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
document: { type: Object, default: {} },
|
|
39
|
-
spiffTypes: { type: Object, default: {} },
|
|
40
|
-
closedate: { type: Date, default: '' },
|
|
41
|
-
month: { type: String, default: '' },
|
|
42
|
-
runner: { type: String, default: '' },
|
|
43
|
-
techs: { type: Object, default: {} }
|
|
44
|
-
}, {});
|
|
45
|
-
|
|
46
|
-
module.exports = {
|
|
47
|
-
Spiff,
|
|
48
|
-
SpiffReport
|
|
49
|
-
}
|
package/old/SystemsSchemes.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
const { Schema } = require('mongoose');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const UserSetting = new Schema({
|
|
5
|
-
empID:{type:String,default:''},
|
|
6
|
-
user:{type:String,defaullt:''},
|
|
7
|
-
type:{type:String,default:''},//optional to connect to a UserProfile
|
|
8
|
-
apps:{type:Object,default:{}},
|
|
9
|
-
admin:{type:Boolean,default:false},
|
|
10
|
-
permissions:{type:Array,default:[]}
|
|
11
|
-
},{
|
|
12
|
-
toJSON: { virtuals: true },
|
|
13
|
-
toObject: { virtuals: true }
|
|
14
|
-
})
|
|
15
|
-
UserSetting.virtual('profile',{
|
|
16
|
-
ref:'UserProfile',
|
|
17
|
-
localField:'type',
|
|
18
|
-
foreignField:'type'
|
|
19
|
-
})
|
|
20
|
-
UserSetting.virtual('employee',{
|
|
21
|
-
ref:'Employee',
|
|
22
|
-
localField:'empID',
|
|
23
|
-
foreignField:'empID'
|
|
24
|
-
})
|
|
25
|
-
const UserProfile = new Schema({
|
|
26
|
-
type:{type:String,default:''},
|
|
27
|
-
apps:{type:Object,default:{}},
|
|
28
|
-
admin:{type:Boolean,default:false},
|
|
29
|
-
permissions:{type:Array,default:[]}
|
|
30
|
-
},{
|
|
31
|
-
toJSON: { virtuals: true },
|
|
32
|
-
toObject: { virtuals: true },
|
|
33
|
-
strictQuery: false,
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
/*
|
|
38
|
-
App Schemes
|
|
39
|
-
|
|
40
|
-
Holds all
|
|
41
|
-
- app index - {
|
|
42
|
-
{
|
|
43
|
-
name:RRB
|
|
44
|
-
group:String,
|
|
45
|
-
work:String
|
|
46
|
-
cat:[]
|
|
47
|
-
views:[]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
- app settings - {
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
*/
|
|
54
|
-
module.exports={
|
|
55
|
-
User:new Schema({
|
|
56
|
-
id:{type:String,default:''},//unique?
|
|
57
|
-
user: {type:String,default:''},//unique
|
|
58
|
-
pswrd: {type:String,default:''},
|
|
59
|
-
lock: {type:Boolean,default:false}
|
|
60
|
-
}),
|
|
61
|
-
UserSetting:UserSetting,
|
|
62
|
-
UserProfile:UserProfile,
|
|
63
|
-
App: new Schema({
|
|
64
|
-
code:{type:String,default:''},
|
|
65
|
-
name:{type:String,default:''},
|
|
66
|
-
config:{type:Object,default:''},
|
|
67
|
-
views:{type:Array,default:[]}
|
|
68
|
-
}),
|
|
69
|
-
General: new Schema({}, {strict:false}),
|
|
70
|
-
Group: new Schema({}, {strict:false})
|
|
71
|
-
}
|
package/old/WorkFlowSchemes.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
const mongoose = require('mongoose');
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var TaskCore = {
|
|
6
|
-
startdate: {type:Date, default:Date.now()},
|
|
7
|
-
duedate:{ type:Date,default:''},
|
|
8
|
-
finishdate:{ type:Date,default:''},
|
|
9
|
-
|
|
10
|
-
complete:{ type:Boolean,default:false},
|
|
11
|
-
level:{ type:String,default:'0'},//0-5
|
|
12
|
-
|
|
13
|
-
workflow:{type:String, default:''}, //id of workflow
|
|
14
|
-
flow: { type:String, default:''}, //id of flow in workflow
|
|
15
|
-
group: { type: String, default: '' }, // refering to database
|
|
16
|
-
work: { type: String, default: '' }, // refering to the collection
|
|
17
|
-
dept: { type: String, default: ''},
|
|
18
|
-
ref: { type: String, default: '' }, // refering to an item in the collection
|
|
19
|
-
type: { type: String, default: ''}, //to identify the type
|
|
20
|
-
assignees: { type: Array, default: [] },
|
|
21
|
-
|
|
22
|
-
checks: { type: Object, default: {} }, // for specific review checks
|
|
23
|
-
|
|
24
|
-
followup: { type: Boolean, default: false },
|
|
25
|
-
employees: { type: Array, default: [] },
|
|
26
|
-
notes: { type: String, default: '' },
|
|
27
|
-
notify: { type: Array, default: [] },
|
|
28
|
-
comments: { type: Array, default: [] },
|
|
29
|
-
logs: {// this is datelog in projects, should we align?
|
|
30
|
-
type: Array, default: [{
|
|
31
|
-
date: Date.now,
|
|
32
|
-
msg: 'Review Created'
|
|
33
|
-
}]
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
let WorkFlowCore = {
|
|
37
|
-
id:{type:String,default:''},
|
|
38
|
-
name:{type:String,default:''},
|
|
39
|
-
dept:{type:String,default:''},
|
|
40
|
-
group:{type:String,default:''},
|
|
41
|
-
work:{type:String,default:''},
|
|
42
|
-
watchers:{type:Array,default:[]},//people responsible for the overall flow
|
|
43
|
-
workheaders:{type:Array,default:[]},
|
|
44
|
-
flow:{type:Array,default:[]}
|
|
45
|
-
}
|
|
46
|
-
/* Workflow.flow example
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
*/
|
|
52
|
-
let TodoCore = {
|
|
53
|
-
type:{type:String,default:''}, // work | watching
|
|
54
|
-
workflow:{type:String,default:''}
|
|
55
|
-
|
|
56
|
-
// type watching only -
|
|
57
|
-
// list:{type:Array,default:[]} // all of the active work
|
|
58
|
-
|
|
59
|
-
// type work only -
|
|
60
|
-
// todo:{type:Object,default:{}}
|
|
61
|
-
// ref: {type:String,default:''} // id of work
|
|
62
|
-
//
|
|
63
|
-
}
|
|
64
|
-
module.exports ={
|
|
65
|
-
ActiveTask:new Schema({...TaskCore},{}),
|
|
66
|
-
FinishedTask:new Schema({...TaskCore},{}),
|
|
67
|
-
WorkFlow:new Schema({...WorkFlowCore},{}),
|
|
68
|
-
Todo:new Schema({...TodoCore}, {strict: false})
|
|
69
|
-
}
|
package/old/spares.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* If Leads will flow through to Quotes and then to Jobs,
|
|
3
|
-
* it should have the same structure as them so things don't need to be re-mapped.
|
|
4
|
-
* It can be a pared-down version of the full Project object, but it should align as much as possible
|
|
5
|
-
*/
|
|
6
|
-
var leadCore = {
|
|
7
|
-
custCode: { type: String, default: '' },
|
|
8
|
-
client: { type: String, default: '' },
|
|
9
|
-
date: { type: Date, default: null },
|
|
10
|
-
email: { type: String, default: '' },
|
|
11
|
-
phone: { type: String, default: '' },
|
|
12
|
-
street: { type: String, default: '' },
|
|
13
|
-
unit: { type: String, default: '' },
|
|
14
|
-
city: { type: String, default: '' },
|
|
15
|
-
zip: { type: String, default: '' },
|
|
16
|
-
comp: { type: String, default: '' },
|
|
17
|
-
dept: { type: String, default: '' },
|
|
18
|
-
estimator: { type: String, default: '' },
|
|
19
|
-
lead: { type: String, default: '' },
|
|
20
|
-
source: { type: String, default: '' },
|
|
21
|
-
log: { type: String, default: '' } //logging lead through lifecycle <- this is taken care of by stage/status now
|
|
22
|
-
}
|