news screen enhancement - 1
This commit is contained in:
@@ -151,6 +151,20 @@ export const WATCHLIST_QUERIES = {
|
||||
`,
|
||||
};
|
||||
|
||||
// ── Screening Universe Queries (bin/daily-screen.ts) ────────────────────────
|
||||
|
||||
export const UNIVERSE_QUERIES = {
|
||||
// Every ticker pinned by any user
|
||||
DISTINCT_WATCHLIST_TICKERS: 'SELECT DISTINCT ticker FROM watchlist ORDER BY ticker',
|
||||
|
||||
// Every ticker held by any user (crypto excluded — not fundamentally scored)
|
||||
DISTINCT_HOLDING_TICKERS: `
|
||||
SELECT DISTINCT ticker FROM holdings
|
||||
WHERE type != 'crypto'
|
||||
ORDER BY ticker
|
||||
`,
|
||||
};
|
||||
|
||||
// ── Signal Snapshot Queries (P0.1 — signal track record) ────────────────────
|
||||
|
||||
export const SIGNAL_SNAPSHOT_QUERIES = {
|
||||
|
||||
@@ -87,10 +87,26 @@ export interface AssetResult {
|
||||
fundamental: ScoreResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data-source health for one screen batch (PRODUCT.md P0.4).
|
||||
* Degraded = a large share of stocks came back without core fundamentals,
|
||||
* which usually means the upstream data source changed or is throttling —
|
||||
* not that the companies are actually missing data.
|
||||
*/
|
||||
export interface DataHealth {
|
||||
degraded: boolean;
|
||||
stocksChecked: number;
|
||||
nullPeRatio: number;
|
||||
nullRoe: number;
|
||||
message: string | null;
|
||||
}
|
||||
|
||||
export interface ScreenerResult {
|
||||
STOCK: AssetResult[];
|
||||
ETF: AssetResult[];
|
||||
BOND: AssetResult[];
|
||||
ERROR: Array<{ ticker: string; message: string }>;
|
||||
marketContext: import('./market.model.js').MarketContext;
|
||||
/** Set by the screener controller on API responses, not by the engine. */
|
||||
dataHealth?: DataHealth;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ export type {
|
||||
ScoringRules,
|
||||
ScoreAudit,
|
||||
ScoreResult,
|
||||
VerdictTier,
|
||||
DataHealth,
|
||||
AssetResult,
|
||||
LiveAssetResult,
|
||||
ScreenerResult,
|
||||
|
||||
Reference in New Issue
Block a user