datasynth_banking/lib.rs
1#![deny(clippy::unwrap_used)]
2//! # synth-banking
3//!
4//! KYC/AML banking transaction generator for synthetic data.
5//!
6//! This crate provides comprehensive banking transaction simulation for:
7//! - Compliance testing and model training
8//! - AML/fraud detection system evaluation
9//! - KYC process simulation
10//! - Regulatory reporting testing
11//!
12//! ## Features
13//!
14//! - **Customer Generation**: Retail, business, and trust customers with realistic KYC profiles
15//! - **Account Generation**: Multiple account types with proper feature sets
16//! - **Transaction Engine**: Persona-based transaction generation with causal drivers
17//! - **AML Typologies**: Structuring, funnel accounts, layering, mule networks, and more
18//! - **Ground Truth Labels**: Multi-level labels for ML training
19//! - **Spoofing Mode**: Adversarial transaction generation for robustness testing
20//!
21//! ## Architecture
22//!
23//! The crate follows a layered architecture:
24//!
25//! ```text
26//! BankingOrchestrator (orchestration)
27//! ↓
28//! Generators (customer, account, transaction, counterparty)
29//! ↓
30//! Typologies (AML pattern injection)
31//! ↓
32//! Labels (ground truth generation)
33//! ↓
34//! Models (customer, account, transaction, KYC)
35//! ```
36//!
37//! ## Usage
38//!
39//! ```rust,ignore
40//! use datasynth_banking::{BankingOrchestrator, BankingConfig};
41//!
42//! let config = BankingConfig::default();
43//! let mut orchestrator = BankingOrchestrator::new(config, 12345);
44//!
45//! // Generate customers and accounts
46//! let customers = orchestrator.generate_customers();
47//! let accounts = orchestrator.generate_accounts(&customers);
48//!
49//! // Generate transaction stream
50//! let transactions = orchestrator.generate_transactions(&accounts);
51//! ```
52
53pub mod generators;
54pub mod labels;
55pub mod models;
56pub mod personas;
57pub mod typologies;
58
59mod config;
60mod orchestrator;
61
62pub use config::*;
63pub use orchestrator::*;
64
65// Re-export key types for convenience
66pub use datasynth_core::models::banking::{
67 AmlTypology, BankAccountType, BankingCustomerType, Direction, LaunderingStage,
68 MerchantCategoryCode, RiskTier, Sophistication, TransactionCategory, TransactionChannel,
69};
70pub use models::{BankAccount, BankTransaction, BankingCustomer, CounterpartyPool, KycProfile};