mod business;
mod retail;
mod trust;
pub use business::get_profile as get_business_profile_impl;
pub use retail::get_profile as get_retail_profile_impl;
pub use trust::get_profile as get_trust_profile_impl;
use datasynth_core::models::banking::{BusinessPersona, RetailPersona, TrustPersona};
#[derive(Debug, Clone)]
pub struct TransactionBehavior {
pub monthly_tx_count: u32,
pub monthly_tx_std: f64,
pub avg_amount: f64,
pub amount_std: f64,
pub min_amount: f64,
pub max_amount: f64,
pub cash_percentage: f64,
pub international_percentage: f64,
pub active_hours: (u8, u8),
pub weekend_multiplier: f64,
}
impl Default for TransactionBehavior {
fn default() -> Self {
Self {
monthly_tx_count: 30,
monthly_tx_std: 10.0,
avg_amount: 150.0,
amount_std: 100.0,
min_amount: 5.0,
max_amount: 5000.0,
cash_percentage: 0.1,
international_percentage: 0.01,
active_hours: (8, 22),
weekend_multiplier: 1.0,
}
}
}
#[derive(Debug, Clone)]
pub struct SpendingProfile {
pub groceries: f64,
pub dining: f64,
pub entertainment: f64,
pub shopping: f64,
pub transportation: f64,
pub utilities: f64,
pub healthcare: f64,
pub travel: f64,
pub other: f64,
}
impl Default for SpendingProfile {
fn default() -> Self {
Self {
groceries: 0.20,
dining: 0.12,
entertainment: 0.08,
shopping: 0.15,
transportation: 0.10,
utilities: 0.15,
healthcare: 0.05,
travel: 0.05,
other: 0.10,
}
}
}
#[derive(Debug, Clone)]
pub struct IncomeProfile {
pub source: IncomeSource,
pub monthly_amount: f64,
pub frequency: IncomeFrequency,
pub income_day: Option<u8>,
pub has_secondary: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum IncomeSource {
Salary,
HourlyWage,
SelfEmployment,
Pension,
SocialSecurity,
Investment,
Rental,
Gig,
ParentalSupport,
Other,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum IncomeFrequency {
Weekly,
BiWeekly,
SemiMonthly,
Monthly,
Irregular,
}
#[derive(Debug, Clone)]
pub struct PersonaProfile {
pub transaction_behavior: TransactionBehavior,
pub spending_profile: SpendingProfile,
pub income_profile: Option<IncomeProfile>,
pub risk_appetite: f64,
pub saving_rate: f64,
pub credit_usage: f64,
}
pub fn get_retail_profile(persona: RetailPersona) -> PersonaProfile {
retail::get_profile(persona)
}
pub fn get_business_profile(persona: BusinessPersona) -> PersonaProfile {
business::get_profile(persona)
}
pub fn get_trust_profile(persona: TrustPersona) -> PersonaProfile {
trust::get_profile(persona)
}