feat: admin-configurable FINRA download URL
- Add finra_config singleton table (base_url + updated_at) - Add getFinraBaseUrl() and setFinraBaseUrl() to admin.ts Resolution order: DB config > env FINRA_BASE_URL > built-in default - Add finraConfig query + finraConfigUpdate mutation to admin tRPC router - Update FinraIngestService.downloadAndIngestFinra to accept optional baseUrl param; falls back to getFinraBaseUrl(db) when omitted - FinraBulkAdapter resolves URL implicitly via the service (no adapter change) - Add migration #10 for existing DBs
This commit is contained in:
@@ -694,3 +694,10 @@ CREATE TABLE IF NOT EXISTS finra_short_interest (
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_finra_symbol ON finra_short_interest(symbol);
|
||||
CREATE INDEX IF NOT EXISTS idx_finra_settlement ON finra_short_interest(settlement_date);
|
||||
|
||||
-- FINRA download configuration (admin-configurable URL).
|
||||
CREATE TABLE IF NOT EXISTS finra_config (
|
||||
id TEXT PRIMARY KEY DEFAULT 'singleton',
|
||||
base_url TEXT NOT NULL DEFAULT 'https://www.finra.org/sites/default/files',
|
||||
updated_at TEXT NOT NULL
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user