@dhyasama/totem-models 6.30.3 → 6.31.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 +6 -6
- package/package.json +1 -1
- package/test/Financials.js +2 -6
package/lib/Financials.js
CHANGED
|
@@ -112,26 +112,26 @@ module.exports = function(mongoose, config) {
|
|
|
112
112
|
// Statics operate on the entire collection
|
|
113
113
|
//////////////////////////////////////////////////////
|
|
114
114
|
|
|
115
|
-
Financials.statics.getByOrg = function getByOrg(orgId, cb) {
|
|
115
|
+
Financials.statics.getByOrg = function getByOrg(customerId, orgId, cb) {
|
|
116
116
|
|
|
117
117
|
var self = this;
|
|
118
118
|
|
|
119
119
|
var query = self.find({
|
|
120
|
-
'
|
|
121
|
-
'
|
|
120
|
+
'customer': customerId,
|
|
121
|
+
'organization': orgId
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
query.exec(cb);
|
|
125
125
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
Financials.statics.getByUUID = function getByUUID(uuid, cb) {
|
|
128
|
+
Financials.statics.getByUUID = function getByUUID(customerId, uuid, cb) {
|
|
129
129
|
|
|
130
130
|
var self = this;
|
|
131
131
|
|
|
132
132
|
var query = self.find({
|
|
133
|
-
'
|
|
134
|
-
'
|
|
133
|
+
'customer': customerId,
|
|
134
|
+
'snapshots.uuid': uuid
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
query.populate('organization', 'name logoUrl')
|
package/package.json
CHANGED
package/test/Financials.js
CHANGED
|
@@ -89,9 +89,7 @@ describe.skip('Financials', function() {
|
|
|
89
89
|
|
|
90
90
|
it('gets financials for an org', function(done) {
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Financials.getByOrg(orgA, function(err, result) {
|
|
92
|
+
Financials.getByOrg(customerA, orgA, function(err, result) {
|
|
95
93
|
should.not.exist(err);
|
|
96
94
|
should.exist(result);
|
|
97
95
|
result.length.should.equal(1);
|
|
@@ -103,9 +101,7 @@ describe.skip('Financials', function() {
|
|
|
103
101
|
|
|
104
102
|
it('gets financials for the same org but different customer', function(done) {
|
|
105
103
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Financials.getByOrg(orgA, function(err, result) {
|
|
104
|
+
Financials.getByOrg(customerA, orgA, function(err, result) {
|
|
109
105
|
should.not.exist(err);
|
|
110
106
|
should.exist(result);
|
|
111
107
|
result.length.should.equal(1);
|