pub struct SegmentedCustomer {Show 14 fields
pub customer_id: String,
pub name: String,
pub segment: CustomerValueSegment,
pub lifecycle_stage: CustomerLifecycleStage,
pub network_position: CustomerNetworkPosition,
pub engagement: CustomerEngagement,
pub segment_assigned_date: NaiveDate,
pub previous_segment: Option<CustomerValueSegment>,
pub segment_change_date: Option<NaiveDate>,
pub industry: Option<String>,
pub annual_contract_value: Decimal,
pub churn_risk_score: f64,
pub upsell_potential: f64,
pub account_manager: Option<String>,
}Expand description
Segmented customer record with full metadata.
Fields§
§customer_id: StringCustomer ID
name: StringCustomer name
segment: CustomerValueSegmentValue segment
lifecycle_stage: CustomerLifecycleStageCurrent lifecycle stage
network_position: CustomerNetworkPositionNetwork position
engagement: CustomerEngagementEngagement metrics
segment_assigned_date: NaiveDateSegment assignment date
previous_segment: Option<CustomerValueSegment>Previous segment (if changed)
segment_change_date: Option<NaiveDate>Segment change date
industry: Option<String>Industry
annual_contract_value: DecimalAnnual contract value
churn_risk_score: f64Churn risk score (0.0 to 1.0)
upsell_potential: f64Upsell potential score (0.0 to 1.0)
account_manager: Option<String>Account manager
Implementations§
Source§impl SegmentedCustomer
impl SegmentedCustomer
Sourcepub fn new(
customer_id: impl Into<String>,
name: impl Into<String>,
segment: CustomerValueSegment,
assignment_date: NaiveDate,
) -> Self
pub fn new( customer_id: impl Into<String>, name: impl Into<String>, segment: CustomerValueSegment, assignment_date: NaiveDate, ) -> Self
Create a new segmented customer.
Sourcepub fn with_lifecycle_stage(self, stage: CustomerLifecycleStage) -> Self
pub fn with_lifecycle_stage(self, stage: CustomerLifecycleStage) -> Self
Set lifecycle stage.
Sourcepub fn with_industry(self, industry: impl Into<String>) -> Self
pub fn with_industry(self, industry: impl Into<String>) -> Self
Set industry.
Sourcepub fn with_annual_contract_value(self, value: Decimal) -> Self
pub fn with_annual_contract_value(self, value: Decimal) -> Self
Set annual contract value.
Sourcepub fn change_segment(
&mut self,
new_segment: CustomerValueSegment,
change_date: NaiveDate,
)
pub fn change_segment( &mut self, new_segment: CustomerValueSegment, change_date: NaiveDate, )
Change segment (with history tracking).
Sourcepub fn calculate_churn_risk(&mut self)
pub fn calculate_churn_risk(&mut self)
Update churn risk score based on engagement and lifecycle.
Sourcepub fn estimated_lifetime_value(&self) -> Decimal
pub fn estimated_lifetime_value(&self) -> Decimal
Get customer lifetime value estimate.
Sourcepub fn is_high_value(&self) -> bool
pub fn is_high_value(&self) -> bool
Check if customer is high value.
Trait Implementations§
Source§impl Clone for SegmentedCustomer
impl Clone for SegmentedCustomer
Source§fn clone(&self) -> SegmentedCustomer
fn clone(&self) -> SegmentedCustomer
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 SegmentedCustomer
impl Debug for SegmentedCustomer
Source§impl<'de> Deserialize<'de> for SegmentedCustomer
impl<'de> Deserialize<'de> for SegmentedCustomer
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 SegmentedCustomer
impl RefUnwindSafe for SegmentedCustomer
impl Send for SegmentedCustomer
impl Sync for SegmentedCustomer
impl Unpin for SegmentedCustomer
impl UnwindSafe for SegmentedCustomer
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