db/specs/modelsold/crm/opportunity.v

58 lines
1.6 KiB
V

module crm
import base
import freeflowuniverse.herolib.data.ourtime
// Opportunity represents a potential sale in the CRM system
pub struct Opportunity {
base.Base // Base struct for common fields (id u32, creation_time, mod_time)
pub mut:
// id u32 // Removed, provided by base.Base
name string
account_id u32 // Reference to Account
amount f64
close_date ourtime.OurTime // Expected close date
probability f64 // Percentage (0-100)
stage OpportunityStage
source OpportunitySource
lead_source string // More specific lead source details if needed
campaign_id u32 // Optional: Reference to Campaign
description string
next_step string // Optional
competition string // Optional
// created_at ourtime.OurTime // Removed, provided by base.Base.creation_time
// updated_at ourtime.OurTime // Removed, provided by base.Base.mod_time
assigned_user_id u32 // Reference to User
created_by_id u32 // Reference to User
contacts []u32 // References to Contacts associated with this opportunity
}
// OpportunityStage represents the stage of an opportunity
pub enum OpportunityStage {
prospecting
qualification
needs_analysis
value_proposition
id_decision_makers
perception_analysis
proposal_price_quote
negotiation_review
closed_won
closed_lost
}
// OpportunitySource represents the source of an opportunity
pub enum OpportunitySource {
call
email
existing_customer
partner
public_relations
campaign
web_site
conference
trade_show
word_of_mouth
other
}