aiden-shared-calculations-unified 1.0.40 → 1.0.41

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.
@@ -67,7 +67,7 @@ class SmartMoneyFlow {
67
67
  let profitableUsersFound = 0;
68
68
  shardSnapshots.forEach((snap, index) => {
69
69
  if (snap.exists) {
70
- const shardData = snap.data().profits || {}; // Assuming data structure { profits: { userId: [...] } }
70
+ const shardData = snap.data() || {};
71
71
  for (const userId in shardData) {
72
72
  const history = shardData[userId];
73
73
  // Check if history is an array and has enough entries
@@ -82,7 +82,7 @@ class UserProfitabilityTracker {
82
82
  shardPromises.push(docRef.get());
83
83
  }
84
84
  const shardSnapshots = await Promise.all(shardPromises);
85
- const existingData = shardSnapshots.map(snap => (snap.exists ? snap.data().profits : {}));
85
+ const existingData = shardSnapshots.map(snap => (snap.exists ? snap.data() : {}) || {});
86
86
 
87
87
 
88
88
  for (const userId in this.dailyData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiden-shared-calculations-unified",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "Shared calculation modules for the BullTrackers Computation System.",
5
5
  "main": "index.js",
6
6
  "files": [