TOGAF ADM × AIB Mock Schema Mapping
How the 275-Table Schema Implements TOGAF Architecture Layers
Quick Index:
- ADM Phase Mappings
- TOGAF Layer Mappings
- Business Architecture (Phase B)
- Information Systems Architecture (Phase C)
- Technology Architecture (Phase D)
- Data Governance (BCBS 239)
ADM Phase Mappings
Phase 0–B (Completed): Business Foundation
| Phase | Artifact | AIB Implementation | Status |
|---|---|---|---|
| Phase 0 | Architecture Principles | Implicit in schema design (tip-off prohibition, dual auth, immutable audit log) | ✓ |
| Phase A | Architecture Vision Document | README.md describes vision (regulatory-complete schema for AI-native bank) | ✓ |
| Phase B | Business Capability Model | BIAN service domain mapping (Table Reference in README) | ✓ |
| Phase B | Business Process Models | Implied by schema structure (e.g., client_onboarding flow) | ✓ Partial |
Phase C (In Progress): Information Systems Architecture
| Phase | Artifact | AIB Implementation | Tables Involved | Status |
|---|---|---|---|---|
| Phase C | Logical Data Model | 275-table schema (ER diagrams in README) | All 275 | ✓ Complete |
| Phase C | Physical Data Model | SQLite schema.sql (constraints, indexes, types) | All 275 | ✓ Complete |
| Phase C | Application Architecture | Not yet documented; implies microservices (aib-compliance, aib-aml, etc.) | N/A | ⚠ To-do |
| Phase C | Integration Patterns | Implicit (REST APIs, Kafka events, batch ETL) | N/A | ⚠ To-do |
Phase D (Planned): Technology Architecture
| Phase | Artifact | AIB Implementation | Status |
|---|---|---|---|
| Phase D | Infrastructure Ref. Architecture | Described in README (Cloudflare D1, Workers, R2) | ⚠ High-level only |
| Phase D | Security Architecture | Implicit (TLS 1.3, AES-256, immutable audit log enforced at DB layer) | ⚠ To-do (full design) |
| Phase D | Non-Functional Requirements | SLAs, RTO/RPO, performance targets | ⚠ To-do |
TOGAF Layer Mappings
TOGAF defines 4 architecture layers; AIB schema covers 3 of 4:
┌──────────────────────────────────────────────────────────────┐
│ LAYER 1: BUSINESS ARCHITECTURE (Phase B) │
├──────────────────────────────────────────────────────────────┤
│ What the bank does: client onboarding, trading, settlement │
│ Implemented via: Business process flows (implicit in schema) │
│ Key tables: client, account, mandate, order_, trade, str │
│ Regulatory alignment: SPG, BankG, MiFID II capabilities │
└──────────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────────┐
│ LAYER 2: INFORMATION ARCHITECTURE (Phase C) │
├──────────────────────────────────────────────────────────────┤
│ What data entities exist & how they relate │
│ Implemented via: 275-table schema with foreign keys │
│ Key domains: Client, Account, Trading, Settlement, AML, GL │
│ ER diagrams: 6 major diagrams in README (client, account, │
│ trading, GL, DORA, risk) │
└──────────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────────┐
│ LAYER 3: SYSTEMS ARCHITECTURE (Phase C) │
├──────────────────────────────────────────────────────────────┤
│ What applications/microservices implement the data model │
│ Implied: aib-compliance, aib-aml, aib-trading, etc. │
│ Status: Architecture defined, implementation underway │
│ NOT YET fully documented (Phase G implementation pending) │
└──────────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────────┐
│ LAYER 4: TECHNOLOGY ARCHITECTURE (Phase D) │
├──────────────────────────────────────────────────────────────┤
│ Infrastructure, platforms, networks, security │
│ Implemented: Cloudflare D1, Workers, R2, Kafka, ELK │
│ Status: High-level defined; detailed design in progress │
└──────────────────────────────────────────────────────────────┘Business Architecture (Phase B)
Domain Model: What AIB Does
The schema is organized into 10 domains, each representing a business capability:
Domain ① Client Lifecycle (Tables 1–10)
Business Capability: End-to-end client management from prospect to termination.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
client | Client master record (individual or legal entity) | SPG Art. 3–4 | Client onboarding capability |
client_contact | Email, phone, address | SPG Art. 4 | Contact management sub-capability |
ubo | Ultimate beneficial owners ≥ 25% | SPG Art. 4(2) | UBO identification capability |
pep_record | Politically exposed person status + 12-month cooling-off | SPG Art. 2 lit. n | PEP screening capability |
sanctions_screen | Multi-list screening + freeze records | SPG Art. 18 | Sanctions compliance capability |
document | KYC documents with verification status | SPG Art. 7 | Document verification capability |
kyc_review | Periodic & trigger-based KYC reviews | SPG Art. 8 | KYC review management capability |
Process Flow (implicit in schema):
ONBOARDING PROCESS:
1. Client submits → client table created (kyc_status = 'pending')
2. KYC review initiated → kyc_review record created
3. Documents uploaded → document table entries (photo ID, proof of address)
4. Sanctions screening → sanctions_screen record (status = 'pass' / 'hit')
5. PEP screening → pep_record created (if hit) or none
6. UBO extraction → ubo table entries + pep_record (if any UBO is PEP)
7. EDD (if high-risk) → pep_edd_review record (sign-off required)
8. KYC approved → kyc_review.status = 'completed' + client.kyc_status = 'approved'
9. Account opened → account table (triggered by kyc_review completion)Capability Maturity (target by 2026):
- Current: L1 (manual document review, 10–15 day turnaround)
- Target: L2 (automated document validation, < 2 day turnaround, immutable audit trail)
- Stretch: L3 (real-time, instant suitability, < 1 hour onboarding)
Domain ② Account & Mandate (Tables 11–17)
Business Capability: Account opening, authorized signatories, investment mandates.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
account | Custody, cash, DPM, advisory account types | BankG Art. 9 | Account creation capability |
account_balance | Per-currency balance snapshot | BankG | Balance tracking capability |
authorized_signatory | Dual authorization (A / A+B) | SPG Art. 4; BankG Art. 35 | Authorization control capability |
suitability_assessment | Full MiFID II questionnaire | MiFID II Art. 25(2) | Suitability assessment capability |
mandate | DPM/advisory mandate with limits | MiFID II Art. 24–25 | Mandate management capability |
mandate_limit_breach | Tracking of limit violations | MiFID II Art. 25 | Limit monitoring capability |
approved_instrument | Per-strategy product governance approval | MiFID II Art. 16(3) | Product approval capability |
Process Flow:
MANDATE ACTIVATION:
1. Suitability assessment completed → suitability_assessment record
2. Mandate created → mandate record (type = 'DPM' / 'advisory')
3. Approved instruments selected → approved_instrument records (one per ISIN per mandate)
4. Orders placed → validated against approved_instrument list (pre-trade gate)
5. Limit breaches tracked → mandate_limit_breach records (if qty > max_weight)Business Rules (enforced at schema or app layer):
suitability_assessment.valid_untilcontrols mandate eligibility (must be refreshed annually)mandate.status∈ {'active', 'suspended', 'closed'} (status change triggers order review)mandate_limit_breachauto-logged if position weight > mandate.max_weight_pct
Domain ③ Product Catalog (Tables 69–72)
Business Capability: Product offerings, pricing, target market.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
product_catalog | AIB product offerings (DPM Balanced, Growth, etc.) | MiFID II Art. 16(3) | Product definition capability |
product_pricing | AUM-tiered fee schedules | MiFID II Art. 24(4) | Pricing management capability |
product_agreement | Client-product agreement lifecycle | BIAN | Product agreement capability |
product_target_market | Target market definition (client type, risk profile) | MiFID II Art. 16(2) | Target market analysis capability |
Business Rules:
product_catalog.min_aum_chfenforces minimum account size (e.g., CHF 250k for private banking)product_pricing.mgmt_fee_bpsvaries byaum_tier_from_chf(tiered pricing)product_target_market.target_client_typeensures product matches client suitability (MiFID II Art. 16(2) check)
Domain ④ Trading & Settlement (Tables 20–27)
Business Capability: Order routing, execution, settlement discipline.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
instrument | Securities master (ISIN, complexity flag) | MiFID II Art. 25 | Instrument reference capability |
instrument_price | Daily closing prices | — | Price feed capability |
order_ | Orders with pre-trade checks | MiFID II Art. 25, 27 | Order management capability |
trade | Executed trades | MiFID II Art. 25; CSDR | Trade execution capability |
settlement | T+2 settlement with discipline | CSDR Art. 5, 7 | Settlement management capability |
settlement_calendar | Market holidays for T+2 calculation | CSDR Art. 5 | Settlement calendar capability |
counterparty | Broker/bank registry | MiFID II Art. 26–27 | Counterparty management capability |
Process Flow (critical for CSDR compliance):
TRADING PROCESS:
1. Order placed → order_ table
├─ Pre-trade checks: suitability, mandate compliance, best execution
└─ suitability_check, mandate_compliance_check, approved_instrument fields
2. Order approved → routed to broker
3. Execution → trade record created (executed_price, settlement_date)
4. Settlement scheduled → settlement record (status = 'scheduled')
├─ intended_sd = trade_date + 2 business days (calculated via settlement_calendar)
5. T+2: Settlement matched or failed
├─ SUCCESS → settlement.status = 'settled', position updated
└─ FAILURE → settlement.fail_days incremented, escalation triggered (T+3)
6. T+2+3: Escalation (ops alert)
7. T+2+4: Buy-in assessment (csdr_buy_in record)
8. T+2+3+: Penalties accrue (csdr_settlement_penalty records)Key Regulatory Constraint:
-- CSDR Art. 7: Settlement discipline
-- Auto-escalate if settlement fails for 3+ days
settlement.t3_escalation_required = (settlement.fail_days >= 3)Domain ⑤ Payments & AML (Tables 30–34)
Business Capability: Payment processing with AML controls.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
bank_transaction | SWIFT/SEPA payments with dual auth | SPG Art. 9 | Payment initiation capability |
aml_typology_rule | Rule definitions triggering alerts | SPG Art. 9; FATF | AML rule management capability |
aml_alert | Investigation queue | SPG Art. 9–10 | Alert investigation capability |
str | STR to FIU-LI (5-day deadline, tip-off = 0) | SPG Art. 17 | STR filing capability |
Key Business Rule (enforced at DB layer):
-- SPG Art. 16: Tip-off Prohibition
-- Cannot disclose STR to the subject (criminal offense)
str.tipped_off INTEGER DEFAULT 0 CHECK(tipped_off = 0)
-- Same for MAR STOR reports
stor_report.tipped_off INTEGER DEFAULT 0 CHECK(tipped_off = 0)Process Flow:
AML MONITORING:
1. Transaction posted → bank_transaction record
2. Real-time screening → aml_typology_rule engine evaluates
├─ Rule 1: Large transaction (> CHF 100k)
├─ Rule 2: High-risk jurisdiction (OFAC, UN lists)
├─ Rule 3: Velocity anomaly (5 transactions in < 1 hour)
└─ If ANY rule matches → aml_alert created
3. Alert investigation → aml_alert.status = 'under_review'
├─ Compliance officer reviews transaction details
├─ Decision: suspicious activity OR false positive
4. If suspicious → STR filed
├─ str record created
├─ str.filing_deadline = today + 5 days (SPG Art. 17)
├─ Immutable audit log: who filed, when, what evidence
└─ FIU-LI submitted via SFTI platform (XML)
5. STR filed → tipped_off MUST = 0 (cannot notify client)Domain ⑥ General Ledger (Tables 51–56)
Business Capability: Double-entry accounting, period close, financial reporting.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
chart_of_accounts | IFRS-aligned account structure | IFRS; BankG | Chart of accounts management |
cost_center | Profit centers, business units | BankG; TOGAF | Cost allocation capability |
accounting_period | Open/soft-closed/hard-closed periods | IFRS; BankG | Period management capability |
journal_entry | Double-entry header | IFRS; BankG | Journal entry creation capability |
journal_line | Debit/credit atomic records | IFRS; BankG | GL posting capability |
trial_balance_snapshot | Period-end aggregation | BankG | Trial balance reporting capability |
Business Rule:
Double-entry enforcement (at application layer):
SUM(journal_line.debit) = SUM(journal_line.credit) per journal_entryRegulatory Alignment:
- Monthly close (soft-close for management reporting, hard-close for regulatory)
- GL reconciled to underlying subsidiary ledgers (AUM by client, trading P&L, etc.)
- Retained for 10 years (BankG requirement)
Domain ⑦ Regulatory Reporting (Tables 35–40, 72–76)
Business Capability: Tax reporting, capital adequacy, regulatory filings.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
tax_classification | FATCA (W-8/W-9) and CRS self-cert | FATCA IGA; OECD CRS | Tax classification capability |
fatca_account_report | Per-account per-year FATCA amounts | FATCA IGA; 30 June | FATCA reporting capability |
crs_account_report | Per-account per-year CRS amounts | OECD CRS; 30 Sept | CRS reporting capability |
compliance_calendar | Consolidated regulatory SLA deadlines | Multiple | Compliance calendar capability |
icaap_snapshot | Basel III CET1 + LCR + NSFR + VaR | BankG Art. 9 | ICAAP reporting capability |
qir | Quarterly investment reports (DPM) | MiFID II Art. 25(6) | QIR generation capability |
Reporting Calendar (implicit in compliance_calendar):
| Report | Frequency | Submission | Data Source |
|---|---|---|---|
| COREP (Capital) | Monthly | 10th of next month | GL + own_funds tables |
| NSFR (Liquidity) | Monthly | 15th | Nostro + funding sources |
| FATCA | Annually | 30 June | fatca_account_report (aggregated) |
| CRS | Annually | 30 Sept | crs_account_report (aggregated) |
| QIR (DPM) | Quarterly | 15 days after quarter-end | qir table |
| ICAAP | Annually | 30 April | icaap_snapshot |
| Annual Accounts | Annually | 31 March (FMA filing) | Trial balance + schedules |
Domain ⑧ DORA & ICT Resilience (Tables 57–61)
Business Capability: ICT asset management, incident reporting, third-party risk.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
ict_asset | Asset inventory (critical/important/standard) | DORA Art. 6, 8 | ICT asset mgmt capability |
ict_incident | Incident lifecycle (4h/72h/1m FMA reporting) | DORA Art. 17–20 | Incident mgmt capability |
ict_third_party_service | Critical ICT third-party contracts | DORA Art. 28–44 | Third-party risk mgmt |
ict_change_record | Change management + rollback | DORA Art. 9 | Change mgmt capability |
tlpt_record | Threat-Led Penetration Testing | DORA Art. 26–27 | TLPT management capability |
Regulatory Compliance (Jan 2025 enforcement date):
- All
ict_incidentclassified as "major" →fma_reportable = 1 - Initial notification to FMA within 4 hours (
fma_initial_notif_at) - Intermediate report within 72 hours
- Final report within 1 month (
fma_final_report_at)
Domain ⑨ Risk Management (Tables 80–87)
Business Capability: Credit, operational, market, and liquidity risk monitoring.
| Table | Business Meaning | Regulatory Driver | Phase B Mapping |
|---|---|---|---|
rcsa_risk_event | Risk self-assessment events | Basel III P2 | Operational risk assessment |
rcsa_control | Control mapping to risk events | Basel III P2 | Control management |
kri_definition | KRI metadata + thresholds | Basel III P2 | KRI definition capability |
kri_reading | Daily/weekly KRI values | Basel III P2 | KRI monitoring capability |
credit_assessment | Lombard credit analysis (LTV, stress) | BankG Art. 9 | Credit assessment capability |
credit_committee_decision | Credit committee sign-off | BankG | Credit decision capability |
liquidity_position | Intraday + projected liquidity buckets | BankG; LCR | Liquidity monitoring |
risk_data_quality | Data quality flags (BCBS 239 P3–P5) | BCBS 239 | Data quality monitoring |
risk_data_lineage | Source → target lineage (BCBS 239 P6) | BCBS 239 | Data governance |
Key Metrics:
kri_reading.status∈ {'green', 'amber', 'red'} (traffic light indicator)- Traffic-light thresholds defined in
kri_definition(green_threshold, amber_threshold, red_threshold) - Red threshold breach → escalation to CRO
Domain ⑩ Advanced Regulatory & Product Domains (Tables 88–275)
SFDR / Taxonomy (Tables 88–93):
- ESG product classification (Art. 6/8/9)
- PAI indicator tracking (principal adverse impacts)
- Taxonomy alignment for green investments
MiCA / Crypto (Tables 94–97):
- Asset-backed token (ART) classification
- Crypto custodian (CASP) authorization tracking
- Travel Rule message records (originator/beneficiary data)
Derivatives & Capital (Tables 98–110, 146–152):
- ISDA master agreements, netting sets
- SA-CCR (counterparty risk) calculations
- CVA risk charges
- FRTB (fundamental review of trading book) positions
Conduct & Governance (Tables 117–122):
- Market sounding interactions (MNPI consent)
- Communication tape records (MiFID II Art. 16(7))
- Whistleblower reports
- DPIA records (GDPR Art. 35)
And More: SFTR (repo reporting), climate risk, large exposures, leverage ratio, SRD II proxy voting, PSD2 SCA, etc.
Information Systems Architecture (Phase C)
Information Model: How Data Flows
The schema is structured in 3 layers:
Layer 1: Master Data (Reference & Identity)
Master data is "write-once" or "change-rarely" data that establishes identity and configuration.
| Entity | Refresh Rate | Business Owner | Example |
|---|---|---|---|
legal_entity | Annual | CEO / Compliance | AIB GmbH (primary bank entity) |
client | Monthly (KYC review) | Compliance Officer | Hans Müller (individual), ABC AG (company) |
instrument | Daily (new listings) | Head of Trading | CH0012221716 (Nestlé share), AAPL (Apple) |
counterparty | Quarterly (broker rating) | Head of Trading | SIX Swiss Exchange, UBS AG |
ref_country, ref_currency, ref_asset_class | Annual | Risk Officer | Switzerland (risk rating), CHF (currency), equity (asset class) |
chart_of_accounts | Annual | CFO | 1-0000 (Assets), 2-0000 (Liabilities) |
cost_center | Annual | Finance Manager | CC-101 (Private Banking), CC-102 (Risk) |
Data Quality: Accuracy critical (client name must match KYC documents, ISIN must exist on exchange)
Layer 2: Transactional Data (Operational Events)
Transactional data represents business events (orders, trades, payments, alerts) — recorded once, rarely updated.
| Entity | Frequency | Retention | Example |
|---|---|---|---|
client_contact | On-change (address update) | 10 years (SPG Art. 22) | Email: hans@example.ch |
kyc_review | Per-review cycle (annual or trigger) | 10 years | KYC review completed 2026-06-01 |
account | On-open/close | 10 years | CHF cash account opened 2025-01-15 |
order_ | Per trade order | 10 years | Buy 100 NESTLÉ @ CHF 95.50 |
trade | Per execution | 10 years | Executed @ CHF 95.45, T+2 settlement |
settlement | Per trade settlement | 10 years | Settled on 2026-06-10 |
bank_transaction | Per payment | 10 years | Wire transfer CHF 50k to ABB AG |
aml_alert | Per rule trigger | 10 years (SPG Art. 22) | Large transaction rule triggered |
str | Per suspicious activity | 10 years (SPG Art. 22) | STR filed 2026-06-05, FIU notified |
journal_entry, journal_line | Per GL posting | 10 years (BankG) | Entry posted to GL daily |
Immutability: Transactional records should be INSERT-only (no UPDATE/DELETE after creation). Corrected via reversals or new entries.
Layer 3: Analytical Data (Aggregations & Metrics)**
Analytical data represents computed metrics, snapshots, and reports — derived from transactional data.
| Entity | Frequency | Volatility | Regulatory Purpose |
|---|---|---|---|
account_balance | Daily | High (changes with trades/payments) | Client statement reporting |
position | Daily | High (mark-to-market) | Portfolio valuation, risk assessment |
trial_balance_snapshot | Monthly | Medium (GL close, then static) | Financial reporting |
icaap_snapshot | Monthly | Medium (capital calculation) | Regulatory capital adequacy |
kri_reading | Daily/Weekly | Medium | Risk monitoring dashboard |
risk_data_quality | Monthly | Low (quality benchmarks stable) | BCBS 239 reporting |
Data Quality: Completeness critical (no missing KRI readings), but can be regenerated from transactional source.
Domain Interactions (Data Flow)
Example: Customer Places Order → Trade → Settlement → Reporting
1. CUSTOMER ORDER (aib-trading-service)
Input: account_id, mandate_id, isin, quantity, direction
├─ Query: account, mandate, approved_instrument
├─ Validate: suitability, mandate compliance, best execution
├─ Create: order_ record
└─ Event: order_placed (Kafka)
2. ORDER EXECUTION (aib-trading-service)
├─ Call: broker API (external system)
├─ Receive: execution price, trade date, settlement date
├─ Create: trade record
├─ Update: order_.status = 'executed'
└─ Event: trade_executed (Kafka)
3. EMIR REPORTING (aib-reporting-service)
├─ Trigger: trade_executed event
├─ Create: emir_trade_report (UTI, ARM submission)
├─ Submit: to ARM within T+1
└─ Record: submission_status, submission_timestamp
4. SETTLEMENT (aib-settlement-service)
├─ Trigger: trade_executed event
├─ Create: settlement record (status = 'scheduled', intended_sd = T+2)
├─ Await: T+2 settlement instruction from CSD
└─ Event: settlement_matched OR settlement_failed (Kafka)
5. POSITION MANAGEMENT (aib-trading-service)
├─ Trigger: settlement_matched event
├─ Update: position (qty, cost_basis, settlement_date)
├─ Event: position_updated (Kafka)
└─ Notify: client (position now reflected in portfolio)
6. QUARTERLY REPORTING (aib-reporting-service)
├─ Trigger: QIR generation (T+15 after quarter-end)
├─ Query: position, trade, account, mandate, instrument
├─ Aggregate: weighted returns, transactions costs, portfolio composition
├─ Create: qir record (MiFID II Art. 25(6))
└─ Send: to client (portal delivery or email)
7. ANNUAL FINANCIAL REPORTING (aib-operations-service)
├─ Trigger: Month-end GL close
├─ Query: trade, settlement, position (T+2 settlement dates)
├─ Post: GL entries for realized/unrealized P&L
├─ Create: trial_balance_snapshot
└─ File: annual accounts with FMA (31 March deadline)Data Lineage (BCBS 239):
- Source:
order_,trade,settlement,position(transactional) - Transform: aggregation, valuation (analytical)
- Target:
qir(regulatory report) - Quality: reconciliation (trade count, settled vs. unsettled)
Technology Architecture (Phase D)
How Tables Map to Cloudflare D1 + Microservices
Database Design (Cloudflare D1 / SQLite)
Schema Organization:
aib-mock (D1 Database)
├─ Client & KYC tables (6 tables)
│ └─ Primary key: client_id (UUID)
│ └─ Indexes: by kyc_status, risk_class, next_review_date
│
├─ Account & Mandate tables (7 tables)
│ └─ Primary key: account_id, mandate_id
│ └─ Foreign keys: client_id (enforced)
│ └─ Indexes: by client_id, account_type, mandate_status
│
├─ Trading tables (11 tables)
│ └─ Primary key: order_id, trade_id, settlement_id
│ └─ Foreign keys: account_id, isin, counterparty_id
│ └─ Indexes: by intended_sd (settlement query), status (monitoring)
│
├─ AML tables (4 tables)
│ └─ Primary key: aml_alert_id, str_id
│ └─ Foreign keys: client_id, rule_id
│ └─ Indexes: by alert_type, status, filing_deadline
│ └─ Constraint: tipped_off = 0 (tip-off prohibition)
│
├─ GL & Accounting tables (6 tables)
│ └─ Primary key: journal_entry_id, journal_line_id
│ └─ Foreign keys: account_code, cost_center_id, period_id
│ └─ Constraint: SUM(debit) = SUM(credit) per entry (app-layer enforced)
│
├─ Regulatory & Risk tables (40+ tables)
│ └─ COREP (capital), NSFR (liquidity), FATCA/CRS (tax)
│ └─ BCBS 239 (data quality), KRI (key risk indicators)
│ └─ DORA (ICT), MiFID II (suitability, trading)
│
└─ Reference & System tables (20+ tables)
└─ ref_country, ref_currency, ref_asset_class, audit_logMicroservice-to-Table Mapping
Each microservice owns a business capability and the data it manages:
| Microservice | Primary Tables | Secondary Tables | Triggers |
|---|---|---|---|
| aib-compliance | client, ubo, document, kyc_review, pep_record, sanctions_screen | account, mandate, product_agreement | kyc_review_status_change → account_opening |
| aib-aml | aml_alert, aml_typology_rule, str, adverse_media_record | bank_transaction | bank_transaction_created → screen rules |
| aib-trading | order_, trade, settlement, counterparty, approved_instrument | mandate, instrument, position | trade_executed → settlement creation + EMIR |
| aib-identity | client, client_contact, account, authorized_signatory | consent_record, dsr_request | client_update → propagate changes |
| aib-operations | bank_transaction, nostro_account, nostro_reconciliation, fee_invoice | account_balance | month_end → fee calculation |
| aib-reporting | qir, emir_trade_report, fatca_account_report, crs_account_report, icaap_snapshot | position, trade, account, journal_line | quarter_end → QIR generation |
| aib-risk | rcsa_risk_event, rcsa_control, kri_reading, kri_definition, credit_assessment | position, trade, settlement, account_balance | daily → KRI calculations |
| aib-audit | audit_log (immutable, append-only) | All tables (for traceability) | All mutations → audit_log entry |
API & Integration Patterns
Synchronous (REST):
GET /clients/{client_id}→ read-heavy queries (client, kyc_review, account)POST /orders→ pre-trade compliance checks, create order_ recordPOST /settlements/{settlement_id}/confirm→ mark settlement as matched
Asynchronous (Kafka):
client.created→ trigger KYC workflow, sanctions screeningkyc_review.completed→ trigger account opening, suitability formtrade.executed→ trigger settlement creation, EMIR reporting, position updatebank_transaction.created→ trigger AML rule evaluation, alert creation
Batch (Scheduled):
- Daily: settle T+2 trades (settlement_calendar logic), KRI readings
- Monthly: GL close (journal_entry balance validation), COREP calculation
- Quarterly: QIR generation (position aggregation by mandate)
Data Governance (BCBS 239)
How BCBS 239 Maps to Schema & Processes
BCBS 239 defines 13 principles for risk data governance. AIB addresses 8 of 13 at Phase C/D:
| Principle | Title | AIB Implementation | Tables |
|---|---|---|---|
| P1 | Risk data architecture | Logical/physical model (275 tables) | All |
| P2 | Risk data governance framework | Data owner assignments, retention policy | risk_data_quality, risk_data_lineage |
| P3 | Risk data accuracy | Validation rules, reconciliation procedures | risk_data_quality |
| P4 | Risk data completeness | Null-checking, mandatory fields | risk_data_quality |
| P5 | Risk data timeliness | Refresh frequency (daily KRI, monthly COREP) | risk_data_quality |
| P6 | Risk data lineage | Source → target tracking | risk_data_lineage |
| P7 | Risk data validation | Pre-publication QA checks | (app-layer, not table) |
| P8 | Risk data flow processes | Event-driven (Kafka) + batch | (infrastructure, Phase D) |
| P9 | Risk data IT infrastructure | Cloudflare D1 + workers | (infrastructure, Phase D) |
| P10 | Risk data addressing errors | Exception handling, correction workflows | (app-layer) |
| P11 | Risk data continuity planning | Backup, disaster recovery, RTO/RPO | (infrastructure, Phase D) |
| P12 | Risk data internal audit | Audit procedures, testing | audit_log (immutable) |
| P13 | Risk data supervisory reporting | COREP, NSFR, ICAAP | pillar3_disclosure, regulatory_filing |
Example: BCBS 239 P3–P6 Implementation (COREP C01 Capital Calculation)
STEP 1: DATA SOURCING (P1 — Architecture)
├─ Source tables:
│ ├─ own_funds_instrument (instrument registry, amounts)
│ ├─ own_funds_deduction (goodwill, DTA, IRB shortfall)
│ ├─ journal_line (GL entries for comprehensive income)
│ └─ All reconciled to trial_balance_snapshot
│
STEP 2: DATA QUALITY CHECKS (P3–P5)
├─ Accuracy: own_funds_instrument totals reconcile to GL accounts (variance ≤ 0.1%)
├─ Completeness: all subsidiary companies included (no missing entities)
├─ Timeliness: data available by 10th of next month (for 15th submission)
└─ Record in: risk_data_quality table (accuracy_flag = 'verified', completeness_pct = 100%)
│
STEP 3: LINEAGE TRACKING (P6)
├─ Create risk_data_lineage record:
│ ├─ target_table: pillar3_disclosure (COREP output)
│ ├─ source_table: own_funds_instrument, own_funds_deduction, journal_line
│ ├─ transformation: CET1 = instruments - deductions + retained earnings + reserves
│ ├─ is_splittable: 0 (aggregated, cannot trace to single client)
│ └─ documented: transformation rule per CRR3 Art. 26–50
│
STEP 4: VALIDATION & PUBLICATION (P7–P8)
├─ Pre-publication checks:
│ ├─ COREP C01 CET1 ≥ minimum ratio (8.25% Pillar 1 + 2)
│ ├─ Reconcile: COREP C01 to audited annual accounts (must match exactly)
│ └─ Exception: if variance > threshold, halt submission, investigate
│
STEP 5: SUPERVISORY REPORTING (P13)
├─ Submit COREP to FMA (XBRL format)
├─ Record: regulatory_filing table (submission_date, confirmation_id)
└─ Archive: all supporting workpapers (linked to audit_log for FMA inspection)Summary: ADM Phases × Schema Tables
| ADM Phase | Focus | Schema Tables | Status | Next Step |
|---|---|---|---|---|
| 0–B | Business foundation | 275 tables (complete) | ✓ Done | Phase C in progress |
| C | Data & applications | 275 tables (logical model) + microservices | ✓ 70% | Document app architecture |
| D | Infrastructure | Cloudflare D1, Workers, Kafka | ⚠ 40% | Detailed security, DR design |
| E–F | Opportunities & migration | 4-wave roadmap (2026–2027) | ⚠ 30% | Business case development |
| G–H | Implementation & feedback | Execution, lessons learned | ⏳ Future | Post-wave 1 review (Sept 2026) |
Last Updated: 2026-06-08 | Version: 1.0