pub struct BankAccount {Show 27 fields
pub account_id: Uuid,
pub account_number: String,
pub account_type: BankAccountType,
pub primary_owner_id: Uuid,
pub joint_owner_ids: Vec<Uuid>,
pub status: AccountStatus,
pub currency: String,
pub opening_date: NaiveDate,
pub closing_date: Option<NaiveDate>,
pub current_balance: Decimal,
pub available_balance: Decimal,
pub features: AccountFeatures,
pub iban: Option<String>,
pub swift_bic: Option<String>,
pub routing_number: Option<String>,
pub branch_code: Option<String>,
pub interest_rate: Option<Decimal>,
pub overdraft_limit: Decimal,
pub last_activity: Option<DateTime<Utc>>,
pub days_dormant: u32,
pub is_nominee: bool,
pub linked_cards: Vec<String>,
pub declared_purpose: Option<String>,
pub funding_source_account: Option<Uuid>,
pub is_mule_account: bool,
pub is_funnel_account: bool,
pub case_id: Option<String>,
}Expand description
A bank account with full metadata.
Fields§
§account_id: UuidUnique account identifier
account_number: StringAccount number (masked for output)
account_type: BankAccountTypeAccount type
primary_owner_id: UuidPrimary owner customer ID
joint_owner_ids: Vec<Uuid>Joint owner customer IDs
status: AccountStatusAccount status
currency: StringAccount currency (ISO 4217)
opening_date: NaiveDateAccount opening date
closing_date: Option<NaiveDate>Account closing date (if closed)
current_balance: DecimalCurrent balance
available_balance: DecimalAvailable balance (may differ due to holds)
features: AccountFeaturesAccount features/capabilities
iban: Option<String>IBAN (for international accounts)
swift_bic: Option<String>BIC/SWIFT code
routing_number: Option<String>Routing number (for US accounts)
branch_code: Option<String>Branch code
interest_rate: Option<Decimal>Interest rate (for savings/CD)
overdraft_limit: DecimalOverdraft limit
last_activity: Option<DateTime<Utc>>Last activity timestamp
days_dormant: u32Days dormant (calculated field)
is_nominee: boolIs this a nominee account
linked_cards: Vec<String>Linked card numbers (masked)
declared_purpose: Option<String>Purpose of account (declared)
funding_source_account: Option<Uuid>Source account for linked funding
is_mule_account: boolWhether this is a mule account
is_funnel_account: boolWhether this is a funnel account
case_id: Option<String>Associated case ID for suspicious activity
Implementations§
Source§impl BankAccount
impl BankAccount
Sourcepub fn new(
account_id: Uuid,
account_number: String,
account_type: BankAccountType,
primary_owner_id: Uuid,
currency: &str,
opening_date: NaiveDate,
) -> Self
pub fn new( account_id: Uuid, account_number: String, account_type: BankAccountType, primary_owner_id: Uuid, currency: &str, opening_date: NaiveDate, ) -> Self
Create a new account.
Sourcepub fn can_transact(&self) -> bool
pub fn can_transact(&self) -> bool
Check if account can process transactions.
Sourcepub fn has_sufficient_funds(&self, amount: Decimal) -> bool
pub fn has_sufficient_funds(&self, amount: Decimal) -> bool
Check if account has sufficient funds for debit.
Sourcepub fn apply_debit(&mut self, amount: Decimal, timestamp: DateTime<Utc>) -> bool
pub fn apply_debit(&mut self, amount: Decimal, timestamp: DateTime<Utc>) -> bool
Apply a debit (outgoing transaction).
Sourcepub fn apply_credit(&mut self, amount: Decimal, timestamp: DateTime<Utc>)
pub fn apply_credit(&mut self, amount: Decimal, timestamp: DateTime<Utc>)
Apply a credit (incoming transaction).
Sourcepub fn place_hold(&mut self, amount: Decimal)
pub fn place_hold(&mut self, amount: Decimal)
Place a hold on funds.
Sourcepub fn release_hold(&mut self, amount: Decimal)
pub fn release_hold(&mut self, amount: Decimal)
Release a hold on funds.
Sourcepub fn mark_dormant(&mut self, days: u32)
pub fn mark_dormant(&mut self, days: u32)
Mark as dormant.
Sourcepub fn add_joint_owner(&mut self, owner_id: Uuid)
pub fn add_joint_owner(&mut self, owner_id: Uuid)
Add a joint owner.
Sourcepub fn all_owner_ids(&self) -> Vec<Uuid>
pub fn all_owner_ids(&self) -> Vec<Uuid>
Get all owner IDs (primary + joint).
Sourcepub fn calculate_risk_score(&self) -> u8
pub fn calculate_risk_score(&self) -> u8
Calculate risk score for the account.
Trait Implementations§
Source§impl Clone for BankAccount
impl Clone for BankAccount
Source§fn clone(&self) -> BankAccount
fn clone(&self) -> BankAccount
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more