aiden-shared-calculations-unified 1.0.41 → 1.0.42
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.
|
@@ -11,8 +11,7 @@ const { Firestore } = require('@google-cloud/firestore');
|
|
|
11
11
|
const firestore = new Firestore();
|
|
12
12
|
const { loadAllPriceData, getDailyPriceChange } = require('../../../utils/price_data_provider');
|
|
13
13
|
const { loadInstrumentMappings, getInstrumentSectorMap } = require('../../../utils/sector_mapping_provider');
|
|
14
|
-
const { loadDataByRefs } = require('../../../../bulltrackers-module/functions/computation-system/utils/data_loader'); // Adjust path as needed
|
|
15
|
-
|
|
14
|
+
const { loadDataByRefs, getPortfolioPartRefs } = require('../../../../bulltrackers-module/functions/computation-system/utils/data_loader'); // Adjust path as needed
|
|
16
15
|
// Config
|
|
17
16
|
const NUM_SHARDS = 50; // Must match the number of shards to read/write
|
|
18
17
|
const ROLLING_DAYS = 90;
|
|
@@ -242,7 +241,7 @@ class UserInvestmentProfile {
|
|
|
242
241
|
const yesterdayDate = new Date(dateStr + 'T00:00:00Z');
|
|
243
242
|
yesterdayDate.setUTCDate(yesterdayDate.getUTCDate() - 1);
|
|
244
243
|
const yesterdayStr = yesterdayDate.toISOString().slice(0, 10);
|
|
245
|
-
const yesterdayRefs = await
|
|
244
|
+
const yesterdayRefs = await getPortfolioPartRefs(config, dependencies, yesterdayStr);
|
|
246
245
|
const yesterdayPortfolios = await loadFullDayMap(config, dependencies, yesterdayRefs);
|
|
247
246
|
logger.log('INFO', `[UserInvestmentProfile] Loaded ${yesterdayRefs.length} part refs for yesterday.`);
|
|
248
247
|
|