@dhyasama/totem-models 11.111.0 → 11.112.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/lib/Financials.js +9 -14
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -22,11 +22,6 @@ module.exports = function(mongoose, config) {
|
|
|
22
22
|
// the date the financial is as of (not the date added to our system)
|
|
23
23
|
asOfDate: { type: Date },
|
|
24
24
|
|
|
25
|
-
fiscal: {
|
|
26
|
-
month: { type: Number, default: 1 },
|
|
27
|
-
day: { type: Number, default: 1 },
|
|
28
|
-
},
|
|
29
|
-
|
|
30
25
|
pins: [{
|
|
31
26
|
name: { type: String, trim: true },
|
|
32
27
|
type: { type: String, enum: [null, 'document', 'metric', 'question'] },
|
|
@@ -62,6 +57,10 @@ module.exports = function(mongoose, config) {
|
|
|
62
57
|
second: { type: Number, default: 0 }
|
|
63
58
|
}
|
|
64
59
|
},
|
|
60
|
+
fiscal: {
|
|
61
|
+
month: { type: Number, default: 12 },
|
|
62
|
+
day: { type: Number, default: 31 },
|
|
63
|
+
},
|
|
65
64
|
review: { type: Boolean, default: false },
|
|
66
65
|
|
|
67
66
|
// For reminding customer about upcoming collections
|
|
@@ -89,8 +88,6 @@ module.exports = function(mongoose, config) {
|
|
|
89
88
|
form: [{
|
|
90
89
|
name: { type: String, trim: true },
|
|
91
90
|
type: { type: String, enum: [null, 'header', 'block', 'document', 'metric', 'question'] },
|
|
92
|
-
budget: { type: Boolean, default: false },
|
|
93
|
-
forecast: { type: Boolean, default: false },
|
|
94
91
|
required: { type: Boolean, default: false }
|
|
95
92
|
}],
|
|
96
93
|
|
|
@@ -104,8 +101,6 @@ module.exports = function(mongoose, config) {
|
|
|
104
101
|
_id: false,
|
|
105
102
|
name: { type: String, trim: true },
|
|
106
103
|
actual: { type: Number },
|
|
107
|
-
budget: { type: Number },
|
|
108
|
-
forecast: { type: Number },
|
|
109
104
|
breakdown: { type: Schema.Types.Mixed }
|
|
110
105
|
}],
|
|
111
106
|
|
|
@@ -208,7 +203,11 @@ module.exports = function(mongoose, config) {
|
|
|
208
203
|
|
|
209
204
|
}
|
|
210
205
|
|
|
211
|
-
}]
|
|
206
|
+
}],
|
|
207
|
+
|
|
208
|
+
projections: [
|
|
209
|
+
|
|
210
|
+
]
|
|
212
211
|
|
|
213
212
|
});
|
|
214
213
|
|
|
@@ -335,8 +334,6 @@ module.exports = function(mongoose, config) {
|
|
|
335
334
|
console.log('Upserting metric:', metric);
|
|
336
335
|
console.log('Upserting metric name:', metric.name);
|
|
337
336
|
console.log('Upserting metric actual:', metric.actual);
|
|
338
|
-
console.log('Upserting metric budget:', metric.budget);
|
|
339
|
-
console.log('Upserting metric forecast:', metric.forecast);
|
|
340
337
|
console.log('Upserting metric breakdown:', metric.breakdown);
|
|
341
338
|
|
|
342
339
|
// Check if the metric exists and update it
|
|
@@ -349,8 +346,6 @@ module.exports = function(mongoose, config) {
|
|
|
349
346
|
{
|
|
350
347
|
$set: {
|
|
351
348
|
'snapshots.$.metrics.$[metric].actual': metric.actual,
|
|
352
|
-
'snapshots.$.metrics.$[metric].budget': metric.budget,
|
|
353
|
-
'snapshots.$.metrics.$[metric].forecast': metric.forecast,
|
|
354
349
|
'snapshots.$.metrics.$[metric].breakdown': metric.breakdown,
|
|
355
350
|
}
|
|
356
351
|
},
|