@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 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
- 'organization': orgId,
121
- 'customer': config.CUSTOMER_ID
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
- 'snapshots.uuid': uuid,
134
- 'customer': config.CUSTOMER_ID
133
+ 'customer': customerId,
134
+ 'snapshots.uuid': uuid
135
135
  });
136
136
 
137
137
  query.populate('organization', 'name logoUrl')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "6.30.3",
3
+ "version": "6.31.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
@@ -89,9 +89,7 @@ describe.skip('Financials', function() {
89
89
 
90
90
  it('gets financials for an org', function(done) {
91
91
 
92
- config.CUSTOMER_ID = customerA;
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
- config.CUSTOMER_ID = customerB;
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);