vhp-mongo-models 1.3.4 → 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.
@@ -8,17 +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
18
  simRef: { type: String, default: '' }, //relace with line
19
19
  imei:{type:String,default:''},
20
20
  userName: { type: String, default: '' },
21
21
  userLock: { type: String, default: '' },
22
+ active:{type:Boolean,default:true},
22
23
  lock: { type: String, default: '' },
23
24
  purchasePrice: { type: Number, default: 0 },
24
25
  purchaseDate: { type: Date, default: '' },
@@ -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: '' }
@@ -12,6 +12,7 @@ module.exports = [
12
12
  city:{type:String,default:''},
13
13
  state:{type:String,default:''},
14
14
  zip:{type:String,default:''},
15
+ contacts:{type:Array,default:[]},
15
16
  location:{type:Object,default:{
16
17
  building_id:'',
17
18
  gers:null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vhp-mongo-models",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "productName": "VHP Mongo Models",
5
5
  "description": "Mongo Models library to setup Mongoose Schemas",
6
6
  "author": "VHPim",
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -1,5 +0,0 @@
1
- const { Schema } = require('mongoose');
2
-
3
- module.exports = {
4
- IndexReport: new Schema({},{strict:false})
5
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }