885f362a29
Replace PSD2 bank integration as the default with file-based bank import (CSV/XML), which better suits Swedish sole traders and small companies. Enable Banking is now an opt-in extension. - Phase 1: Extract generic transaction ingestion service (ingest.ts) with dedup, auto-categorization, and OCR-based invoice matching - Phase 2: Bank file parser library supporting Nordea, SEB, Swedbank, Handelsbanken CSV formats and ISO 20022 camt.053 XML - Phase 3: Database migration adding import_source, reference columns and bank_file_imports tracking table - Phase 4: Import wizard UI (5-step flow) and API routes for parse/execute - Phase 5: Move Enable Banking to extensions/enable-banking/ with commented-out loader entry for opt-in activation - Phase 6: 104 new tests (ingestion + all parser formats), fixing Nordea detection overlap and camt.053 XML tag collision bugs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { extensionRegistry } from './registry'
|
|
import { receiptOcrExtension } from '@/extensions/receipt-ocr'
|
|
import { aiCategorizationExtension } from '@/extensions/ai-categorization'
|
|
import { pushNotificationsExtension } from '@/extensions/push-notifications'
|
|
import { sruExportExtension } from '@/extensions/sru-export'
|
|
import { neBilagaExtension } from '@/extensions/ne-bilaga'
|
|
import { aiChatExtension } from '@/extensions/ai-chat'
|
|
import type { Extension } from './types'
|
|
|
|
// ── Enable Banking (PSD2) — opt-in extension ───────────────────────────
|
|
// Uncomment the following line to enable automatic PSD2 bank transaction sync.
|
|
// Requires ENABLE_BANKING_APP_ID and ENABLE_BANKING_PRIVATE_KEY env vars.
|
|
//
|
|
// import { enableBankingExtension } from '@/extensions/enable-banking'
|
|
|
|
/**
|
|
* Explicit list of first-party extensions.
|
|
*
|
|
* Next.js bundling requires static imports — no dynamic filesystem scanning.
|
|
* Add extensions here as they are built.
|
|
*/
|
|
const FIRST_PARTY_EXTENSIONS: Extension[] = [
|
|
receiptOcrExtension,
|
|
aiCategorizationExtension,
|
|
pushNotificationsExtension,
|
|
sruExportExtension,
|
|
neBilagaExtension,
|
|
aiChatExtension,
|
|
// enableBankingExtension, // Uncomment to activate PSD2 bank sync
|
|
]
|
|
|
|
let loaded = false
|
|
|
|
/**
|
|
* Load and register all first-party extensions.
|
|
* Idempotent — safe to call multiple times.
|
|
*/
|
|
export function loadExtensions(): void {
|
|
if (loaded) return
|
|
loaded = true
|
|
|
|
for (const extension of FIRST_PARTY_EXTENSIONS) {
|
|
extensionRegistry.register(extension)
|
|
}
|
|
}
|