datasynth_banking/personas/
mod.rs1mod business;
9mod retail;
10mod trust;
11
12pub use business::get_profile as get_business_profile_impl;
14pub use retail::get_profile as get_retail_profile_impl;
15pub use trust::get_profile as get_trust_profile_impl;
16
17use datasynth_core::models::banking::{BusinessPersona, RetailPersona, TrustPersona};
18
19#[derive(Debug, Clone)]
21pub struct TransactionBehavior {
22 pub monthly_tx_count: u32,
24 pub monthly_tx_std: f64,
26 pub avg_amount: f64,
28 pub amount_std: f64,
30 pub min_amount: f64,
32 pub max_amount: f64,
34 pub cash_percentage: f64,
36 pub international_percentage: f64,
38 pub active_hours: (u8, u8),
40 pub weekend_multiplier: f64,
42}
43
44impl Default for TransactionBehavior {
45 fn default() -> Self {
46 Self {
47 monthly_tx_count: 30,
48 monthly_tx_std: 10.0,
49 avg_amount: 150.0,
50 amount_std: 100.0,
51 min_amount: 5.0,
52 max_amount: 5000.0,
53 cash_percentage: 0.1,
54 international_percentage: 0.01,
55 active_hours: (8, 22),
56 weekend_multiplier: 1.0,
57 }
58 }
59}
60
61#[derive(Debug, Clone)]
63pub struct SpendingProfile {
64 pub groceries: f64,
66 pub dining: f64,
68 pub entertainment: f64,
70 pub shopping: f64,
72 pub transportation: f64,
74 pub utilities: f64,
76 pub healthcare: f64,
78 pub travel: f64,
80 pub other: f64,
82}
83
84impl Default for SpendingProfile {
85 fn default() -> Self {
86 Self {
87 groceries: 0.20,
88 dining: 0.12,
89 entertainment: 0.08,
90 shopping: 0.15,
91 transportation: 0.10,
92 utilities: 0.15,
93 healthcare: 0.05,
94 travel: 0.05,
95 other: 0.10,
96 }
97 }
98}
99
100#[derive(Debug, Clone)]
102pub struct IncomeProfile {
103 pub source: IncomeSource,
105 pub monthly_amount: f64,
107 pub frequency: IncomeFrequency,
109 pub income_day: Option<u8>,
111 pub has_secondary: bool,
113}
114
115#[derive(Debug, Clone, Copy, PartialEq, Eq)]
117pub enum IncomeSource {
118 Salary,
119 HourlyWage,
120 SelfEmployment,
121 Pension,
122 SocialSecurity,
123 Investment,
124 Rental,
125 Gig,
126 ParentalSupport,
127 Other,
128}
129
130#[derive(Debug, Clone, Copy, PartialEq, Eq)]
132pub enum IncomeFrequency {
133 Weekly,
134 BiWeekly,
135 SemiMonthly,
136 Monthly,
137 Irregular,
138}
139
140#[derive(Debug, Clone)]
142pub struct PersonaProfile {
143 pub transaction_behavior: TransactionBehavior,
145 pub spending_profile: SpendingProfile,
147 pub income_profile: Option<IncomeProfile>,
149 pub risk_appetite: f64,
151 pub saving_rate: f64,
153 pub credit_usage: f64,
155}
156
157pub fn get_retail_profile(persona: RetailPersona) -> PersonaProfile {
159 retail::get_profile(persona)
160}
161
162pub fn get_business_profile(persona: BusinessPersona) -> PersonaProfile {
164 business::get_profile(persona)
165}
166
167pub fn get_trust_profile(persona: TrustPersona) -> PersonaProfile {
169 trust::get_profile(persona)
170}