bulltrackers-module 1.0.129 → 1.0.130
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.
|
@@ -12,15 +12,25 @@ function checkRootDependencies(calcManifest, rootDataStatus) { if (!calcManifest
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** Stage 3: Check root data availability for a date */
|
|
15
|
-
|
|
15
|
+
// --- START FIX ---
|
|
16
|
+
// The signature is changed from '{ logger, ...deps }' to 'dependencies'
|
|
17
|
+
// to ensure the full object is passed down.
|
|
18
|
+
async function checkRootDataAvailability(dateStr, config, dependencies) {
|
|
19
|
+
const { logger } = dependencies; // Destructure logger for local use
|
|
16
20
|
logger.log('INFO', `[PassRunner] Checking root data for ${dateStr}...`);
|
|
17
21
|
try {
|
|
18
|
-
const [portfolioRefs, insightsData, socialData, historyRefs] = await Promise.all([
|
|
22
|
+
const [portfolioRefs, insightsData, socialData, historyRefs] = await Promise.all([
|
|
23
|
+
getPortfolioPartRefs(config, dependencies, dateStr), // Pass full 'dependencies'
|
|
24
|
+
loadDailyInsights(config, dependencies, dateStr), // Pass full 'dependencies'
|
|
25
|
+
loadDailySocialPostInsights(config, dependencies, dateStr), // Pass full 'dependencies'
|
|
26
|
+
getHistoryPartRefs(config, dependencies, dateStr) // Pass full 'dependencies'
|
|
27
|
+
]);
|
|
19
28
|
const hasPortfolio = !!(portfolioRefs?.length), hasInsights = !!insightsData, hasSocial = !!socialData, hasHistory = !!(historyRefs?.length);
|
|
20
29
|
if (!(hasPortfolio||hasInsights||hasSocial||hasHistory)) { logger.log('WARN', `[PassRunner] No root data for ${dateStr}.`); return null; }
|
|
21
30
|
return { portfolioRefs: portfolioRefs||[], insightsData: insightsData||null, socialData: socialData||null, historyRefs: historyRefs||[], status: { hasPortfolio, hasInsights, hasSocial, hasHistory } };
|
|
22
31
|
} catch (err) { logger.log('ERROR', `[PassRunner] Error checking data for ${dateStr}`, { errorMessage: err.message }); return null; }
|
|
23
32
|
}
|
|
33
|
+
// --- END FIX ---
|
|
24
34
|
|
|
25
35
|
/** Stage 4: Fetch computed dependencies from Firestore */
|
|
26
36
|
async function fetchDependenciesForPass(dateStr, calcsInPass, fullManifest, config, { db, logger }) {
|
|
@@ -85,4 +95,4 @@ async function runMetaComputationPass(date, calcs, passName, config, deps, fetch
|
|
|
85
95
|
logger.log(success===calcs.length?'SUCCESS':'WARN', `[${passName}] Completed ${dStr}. Success: ${success}/${calcs.length}`);
|
|
86
96
|
}
|
|
87
97
|
|
|
88
|
-
module.exports = { groupByPass, checkRootDataAvailability, fetchDependenciesForPass, filterCalculations, runStandardComputationPass, runMetaComputationPass };
|
|
98
|
+
module.exports = { groupByPass, checkRootDataAvailability, fetchDependenciesForPass, filterCalculations, runStandardComputationPass, runMetaComputationPass };
|