Skip to main content

datasynth_eval/banking/
mod.rs

1//! Banking/KYC/AML evaluation module.
2//!
3//! Validates banking data including KYC profile completeness
4//! and AML typology coherence and detectability.
5
6pub mod aml_detectability;
7pub mod kyc_completeness;
8
9pub use aml_detectability::{
10    AmlDetectabilityAnalysis, AmlDetectabilityAnalyzer, AmlTransactionData, TypologyData,
11};
12pub use kyc_completeness::{KycCompletenessAnalysis, KycCompletenessAnalyzer, KycProfileData};
13
14use serde::{Deserialize, Serialize};
15
16/// Combined banking evaluation results.
17#[derive(Debug, Clone, Serialize, Deserialize)]
18pub struct BankingEvaluation {
19    /// KYC completeness analysis.
20    pub kyc: Option<KycCompletenessAnalysis>,
21    /// AML detectability analysis.
22    pub aml: Option<AmlDetectabilityAnalysis>,
23    /// Overall pass/fail.
24    pub passes: bool,
25    /// Issues found.
26    pub issues: Vec<String>,
27}
28
29impl BankingEvaluation {
30    /// Create a new empty evaluation.
31    pub fn new() -> Self {
32        Self {
33            kyc: None,
34            aml: None,
35            passes: true,
36            issues: Vec::new(),
37        }
38    }
39
40    /// Check thresholds and update pass status.
41    pub fn check_thresholds(&mut self) {
42        self.issues.clear();
43        if let Some(ref kyc) = self.kyc {
44            if !kyc.passes {
45                self.issues.extend(kyc.issues.clone());
46            }
47        }
48        if let Some(ref aml) = self.aml {
49            if !aml.passes {
50                self.issues.extend(aml.issues.clone());
51            }
52        }
53        self.passes = self.issues.is_empty();
54    }
55}
56
57impl Default for BankingEvaluation {
58    fn default() -> Self {
59        Self::new()
60    }
61}