Files
boc/aamos-ledger-rust/migrations/20250101000003_create_journal_lines.sql
T
Bernt bae705aa97 ARCHITECTURE: NFC roadmap, edge AI, audit logging
- Add NFC ePassport roadmap (ICAO 9303, eIDAS)
- Add TensorFlow.js edge face detection (BlazeFace)
- Add structured audit logger (GDPR-compliant)
- Risk scoring support

Part of KYC Apple Native UX v1.1.0
2026-06-29 16:24:48 +00:00

17 lines
645 B
SQL

CREATE TABLE IF NOT EXISTS journal_lines (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
journal_entry_id UUID NOT NULL REFERENCES journal_entries(id) ON DELETE CASCADE,
account_id UUID NOT NULL REFERENCES accounts(id),
description TEXT,
debit NUMERIC(19, 4),
credit NUMERIC(19, 4),
CONSTRAINT check_debit_credit CHECK (
(debit IS NOT NULL AND credit IS NULL) OR
(debit IS NULL AND credit IS NOT NULL) OR
(debit IS NULL AND credit IS NULL)
)
);
CREATE INDEX idx_journal_lines_entry ON journal_lines(journal_entry_id);
CREATE INDEX idx_journal_lines_account ON journal_lines(account_id);