aiden-shared-calculations-unified 1.0.51 → 1.0.53

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.
@@ -39,7 +39,13 @@ class DailyBoughtVsSoldCount {
39
39
  }
40
40
 
41
41
  getResult() {
42
- // Return the final aggregated counts
42
+ // --- ADD THIS CHECK ---
43
+ if (!this.processedDay) {
44
+ console.warn('[DailyBoughtVsSoldCount] getResult called but process never ran (missing insights). Returning null for backfill.');
45
+ return null;
46
+ }
47
+ // --- END ADD ---
48
+
43
49
  return {
44
50
  total_positions_bought_delta: this.totalBought,
45
51
  total_positions_sold_delta: this.totalSold
@@ -33,10 +33,16 @@ class DailyBuySellSentimentCount {
33
33
  }
34
34
 
35
35
  getResult() {
36
- // Return the final rounded sums
36
+ // --- ADD THIS CHECK ---
37
+ if (!this.processedDay) {
38
+ console.warn('[DailyBuySellSentimentCount] getResult called but process never ran (missing insights). Returning null for backfill.');
39
+ return null;
40
+ }
41
+ // --- END ADD ---
42
+
37
43
  return {
38
44
  total_buy_positions: Math.round(this.totalBuyPositions),
39
- total_sell_positions: Math.round(this.totalSellPositions) // 'sell' are shorts
45
+ total_sell_positions: Math.round(this.totalSellPositions)
40
46
  };
41
47
  }
42
48
 
@@ -42,7 +42,13 @@ class DailyOwnershipDelta {
42
42
  }
43
43
 
44
44
  getResult() {
45
- // Return the final calculated delta for each ticker
45
+ // --- ADD THIS CHECK ---
46
+ if (!this.processedDay) {
47
+ console.warn('[DailyOwnershipDelta] getResult called but process never ran (missing insights). Returning null for backfill.');
48
+ return null;
49
+ }
50
+ // --- END ADD ---
51
+
46
52
  return this.deltaByTicker;
47
53
  }
48
54
 
@@ -25,7 +25,13 @@ class DailyTotalPositionsHeld {
25
25
  }
26
26
 
27
27
  getResult() {
28
- // Return the final sum
28
+ // --- ADD THIS CHECK ---
29
+ if (!this.processedDay) {
30
+ console.warn('[DailyTotalPositionsHeld] getResult called but process never ran (missing insights). Returning null for backfill.');
31
+ return null;
32
+ }
33
+ // --- END ADD ---
34
+
29
35
  return {
30
36
  total_positions_held: this.totalPositions
31
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiden-shared-calculations-unified",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "Shared calculation modules for the BullTrackers Computation System.",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -9,7 +9,9 @@
9
9
  "utils/"
10
10
  ],
11
11
  "scripts": {
12
- "test": "echo \"Error: no test specified\" && exit 1"
12
+ "test": "echo \"Error: no test specified\" && exit 1",
13
+ "postpublish": "node ./auto-deploy.js",
14
+ "release": "node ./release.js"
13
15
  },
14
16
  "keywords": [
15
17
  "bulltrackers",
@@ -23,6 +25,9 @@
23
25
  "sharedsetup": "latest",
24
26
  "require-all": "^3.0.0"
25
27
  },
28
+ "devDependencies": {
29
+ "bulltracker-deployer": "file:../bulltracker-deployer"
30
+ },
26
31
  "engines": {
27
32
  "node": ">=20"
28
33
  },