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:
Investor Flow Build
2026-07-25 13:11:50 -04:00
parent 0b9df1e9d3
commit 8a00363dd0
5 changed files with 48 additions and 5 deletions
+7
View File
@@ -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
);