pub struct VendorRelationship {Show 18 fields
pub vendor_id: String,
pub relationship_type: VendorRelationshipType,
pub tier: SupplyChainTier,
pub strategic_importance: StrategicLevel,
pub spend_tier: SpendTier,
pub cluster: VendorCluster,
pub start_date: NaiveDate,
pub end_date: Option<NaiveDate>,
pub lifecycle_stage: VendorLifecycleStage,
pub payment_history: PaymentHistory,
pub quality_score: VendorQualityScore,
pub parent_vendor: Option<String>,
pub child_vendors: Vec<String>,
pub dependency: Option<VendorDependency>,
pub annual_spend: Decimal,
pub contract_id: Option<String>,
pub primary_contact: Option<String>,
pub notes: Option<String>,
}Expand description
Vendor relationship in the supply chain network.
Fields§
§vendor_id: StringVendor ID
relationship_type: VendorRelationshipTypeType of relationship
tier: SupplyChainTierSupply chain tier
strategic_importance: StrategicLevelStrategic importance level
spend_tier: SpendTierSpend tier classification
cluster: VendorClusterBehavioral cluster
start_date: NaiveDateRelationship start date
end_date: Option<NaiveDate>Relationship end date (if terminated)
lifecycle_stage: VendorLifecycleStageCurrent lifecycle stage
payment_history: PaymentHistoryPayment history summary
quality_score: VendorQualityScoreQuality score
parent_vendor: Option<String>Parent vendor ID (for Tier 2/3)
child_vendors: Vec<String>Child vendor IDs (suppliers to this vendor)
dependency: Option<VendorDependency>Dependency analysis
annual_spend: DecimalAnnual spend amount
contract_id: Option<String>Contract reference
primary_contact: Option<String>Primary contact
notes: Option<String>Notes
Implementations§
Source§impl VendorRelationship
impl VendorRelationship
Sourcepub fn new(
vendor_id: impl Into<String>,
relationship_type: VendorRelationshipType,
tier: SupplyChainTier,
start_date: NaiveDate,
) -> Self
pub fn new( vendor_id: impl Into<String>, relationship_type: VendorRelationshipType, tier: SupplyChainTier, start_date: NaiveDate, ) -> Self
Create a new vendor relationship.
Sourcepub fn with_strategic_importance(self, level: StrategicLevel) -> Self
pub fn with_strategic_importance(self, level: StrategicLevel) -> Self
Set strategic importance.
Sourcepub fn with_spend_tier(self, tier: SpendTier) -> Self
pub fn with_spend_tier(self, tier: SpendTier) -> Self
Set spend tier.
Sourcepub fn with_cluster(self, cluster: VendorCluster) -> Self
pub fn with_cluster(self, cluster: VendorCluster) -> Self
Set cluster.
Sourcepub fn with_parent(self, parent_id: impl Into<String>) -> Self
pub fn with_parent(self, parent_id: impl Into<String>) -> Self
Set parent vendor (for Tier 2/3).
Sourcepub fn with_annual_spend(self, spend: Decimal) -> Self
pub fn with_annual_spend(self, spend: Decimal) -> Self
Set annual spend.
Sourcepub fn relationship_age_days(&self, as_of: NaiveDate) -> i64
pub fn relationship_age_days(&self, as_of: NaiveDate) -> i64
Calculate relationship age in days.
Sourcepub fn relationship_score(&self) -> f64
pub fn relationship_score(&self) -> f64
Get composite relationship score.
Trait Implementations§
Source§impl Clone for VendorRelationship
impl Clone for VendorRelationship
Source§fn clone(&self) -> VendorRelationship
fn clone(&self) -> VendorRelationship
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 VendorRelationship
impl Debug for VendorRelationship
Source§impl<'de> Deserialize<'de> for VendorRelationship
impl<'de> Deserialize<'de> for VendorRelationship
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 VendorRelationship
impl RefUnwindSafe for VendorRelationship
impl Send for VendorRelationship
impl Sync for VendorRelationship
impl Unpin for VendorRelationship
impl UnwindSafe for VendorRelationship
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