pub struct CustomerNetworkPosition {
pub customer_id: String,
pub referred_by: Option<String>,
pub referrals_made: Vec<String>,
pub parent_customer: Option<String>,
pub child_customers: Vec<String>,
pub billing_consolidation: bool,
pub industry_cluster_id: Option<String>,
pub region: Option<String>,
pub network_join_date: Option<NaiveDate>,
}Expand description
Customer network position for referrals and hierarchies.
Fields§
§customer_id: StringCustomer ID
referred_by: Option<String>Customer who referred this customer
referrals_made: Vec<String>Customers this customer referred
parent_customer: Option<String>Parent customer in corporate hierarchy
child_customers: Vec<String>Child customers in corporate hierarchy
billing_consolidation: boolWhether billing is consolidated to parent
industry_cluster_id: Option<String>Industry cluster for similar customer analysis
region: Option<String>Geographic region
network_join_date: Option<NaiveDate>Date joined the network
Implementations§
Source§impl CustomerNetworkPosition
impl CustomerNetworkPosition
Sourcepub fn with_referral(self, referrer_id: impl Into<String>) -> Self
pub fn with_referral(self, referrer_id: impl Into<String>) -> Self
Set referral source.
Sourcepub fn with_parent(self, parent_id: impl Into<String>) -> Self
pub fn with_parent(self, parent_id: impl Into<String>) -> Self
Set parent in corporate hierarchy.
Sourcepub fn add_referral(&mut self, referred_id: impl Into<String>)
pub fn add_referral(&mut self, referred_id: impl Into<String>)
Add a referral made.
Sourcepub fn network_influence(&self) -> usize
pub fn network_influence(&self) -> usize
Get total network influence (referrals + children).
Sourcepub fn was_referred(&self) -> bool
pub fn was_referred(&self) -> bool
Check if this customer was referred.
Trait Implementations§
Source§impl Clone for CustomerNetworkPosition
impl Clone for CustomerNetworkPosition
Source§fn clone(&self) -> CustomerNetworkPosition
fn clone(&self) -> CustomerNetworkPosition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomerNetworkPosition
impl Debug for CustomerNetworkPosition
Source§impl<'de> Deserialize<'de> for CustomerNetworkPosition
impl<'de> Deserialize<'de> for CustomerNetworkPosition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CustomerNetworkPosition
impl RefUnwindSafe for CustomerNetworkPosition
impl Send for CustomerNetworkPosition
impl Sync for CustomerNetworkPosition
impl Unpin for CustomerNetworkPosition
impl UnwindSafe for CustomerNetworkPosition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more