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:
@@ -232,6 +232,17 @@ function runMigrations(db: DatabaseSync): void {
|
||||
)
|
||||
`);
|
||||
} catch { /* ignore */ }
|
||||
|
||||
// 10. FINRA config table for admin-configurable download URL.
|
||||
try {
|
||||
db.exec(`
|
||||
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
|
||||
)
|
||||
`);
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
|
||||
let _db: DatabaseSync | null = null;
|
||||
|
||||
Reference in New Issue
Block a user