bulltrackers-module 1.0.680 → 1.0.681
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.
|
@@ -222,21 +222,13 @@ async function processAlertForPI(db, logger, piCid, alertType, computationMetada
|
|
|
222
222
|
async function findSubscriptionsForPI(db, logger, piCid, alertTypeId, computationDate, dependencies = {}) {
|
|
223
223
|
const subscriptions = [];
|
|
224
224
|
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
'NewSectorExposure': 'newSector',
|
|
230
|
-
'PositionInvestedIncrease': 'increasedPositionSize',
|
|
231
|
-
'NewSocialPost': 'newSocialPost',
|
|
232
|
-
// [NEW] Mapping for BehavioralAnomaly
|
|
233
|
-
'BehavioralAnomaly': 'behavioralAnomaly',
|
|
234
|
-
'TestSystemProbe': 'increasedRisk' // Hack: Map to 'increasedRisk' key
|
|
235
|
-
};
|
|
225
|
+
// [DYNAMIC] Get configKey from alertType metadata instead of hardcoded mapping
|
|
226
|
+
// The alertType is passed in dependencies and contains the configKey from computation metadata
|
|
227
|
+
const alertType = dependencies.alertType;
|
|
228
|
+
const configKey = alertType?.configKey;
|
|
236
229
|
|
|
237
|
-
const configKey = computationToConfigKey[alertTypeId];
|
|
238
230
|
if (!configKey) {
|
|
239
|
-
logger.log('WARN', `[findSubscriptionsForPI] No
|
|
231
|
+
logger.log('WARN', `[findSubscriptionsForPI] No configKey found for alert type: ${alertTypeId}`);
|
|
240
232
|
return subscriptions;
|
|
241
233
|
}
|
|
242
234
|
|
|
@@ -264,8 +256,8 @@ async function findSubscriptionsForPI(db, logger, piCid, alertTypeId, computatio
|
|
|
264
256
|
increasedPositionSize: true,
|
|
265
257
|
newSocialPost: true,
|
|
266
258
|
newPositions: true,
|
|
267
|
-
|
|
268
|
-
|
|
259
|
+
behavioralAnomaly: true,
|
|
260
|
+
testSystemProbe: true // Test alerts for developers
|
|
269
261
|
};
|
|
270
262
|
|
|
271
263
|
// Check all developer accounts
|