bulltrackers-module 1.0.85 → 1.0.87

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.
@@ -183,14 +183,28 @@ async function streamAndProcess(
183
183
  yesterdayPortfolios = {},
184
184
  todayInsights = null,
185
185
  yesterdayInsights = null,
186
- todaySocialPostInsights = null, // <-- NEW
187
- yesterdaySocialPostInsights = null // <-- NEW
186
+ todaySocialPostInsights = null,
187
+ yesterdaySocialPostInsights = null
188
188
  ) {
189
189
  const { db, logger } = dependencies;
190
190
  logger.log('INFO', `[${passName}] Streaming ${todayRefs.length} 'today' part docs for ${dateStr}...`);
191
191
 
192
+ // --- START MODIFICATION ---
193
+ // Calculate yesterday's date string
194
+ const yesterdayDate = new Date(dateStr + 'T00:00:00Z');
195
+ yesterdayDate.setUTCDate(yesterdayDate.getUTCDate() - 1);
196
+ const yesterdayStr = yesterdayDate.toISOString().slice(0, 10);
197
+
192
198
  const { instrumentToTicker, instrumentToSector } = await unifiedUtils.loadInstrumentMappings();
193
- const context = { instrumentMappings: instrumentToTicker, sectorMapping: instrumentToSector };
199
+ // Add date strings to the context
200
+ const context = {
201
+ instrumentMappings: instrumentToTicker,
202
+ sectorMapping: instrumentToSector,
203
+ todayDateStr: dateStr,
204
+ yesterdayDateStr: yesterdayStr
205
+ };
206
+ // --- END MODIFICATION ---
207
+
194
208
  const batchSize = config.partRefBatchSize || 10;
195
209
  let isFirstUser = true; // Flag for insights/social calculations
196
210
 
@@ -17,7 +17,8 @@ const HISTORICAL_CALC_NAMES = new Set([
17
17
  // --- ADD THESE THREE LINES ---
18
18
  'deposit-withdrawal-percentage',
19
19
  'new-allocation-percentage',
20
- 'reallocation-increase-percentage'
20
+ 'reallocation-increase-percentage',
21
+ 'asset-crowd-flow' // <-- ADD THIS LINE
21
22
  ]);
22
23
  const historicalCalculations = {};
23
24
  const dailyCalculations = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -32,11 +32,11 @@
32
32
  "@google-cloud/firestore": "^7.11.3",
33
33
  "sharedsetup": "latest",
34
34
  "require-all": "^3.0.0",
35
- "aiden-shared-calculations-unified": "1.0.9",
35
+ "aiden-shared-calculations-unified": "1.0.12",
36
36
  "@google-cloud/pubsub": "latest",
37
37
  "express": "^4.19.2",
38
38
  "cors": "^2.8.5",
39
- "p-limit": "latest"
39
+ "p-limit": "^3.1.0"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=20"