Api reference
components.growth.public.business_logic ¶
conversation_management ¶
hubspot ¶
lead_generation_resources ¶
referral ¶
ReferralActions ¶
Actions for the referral lifecycle.
add_contract_to_referral ¶
Add a contract reference to be rewarded for the referral.
Source code in components/growth/subcomponents/referral/protected/actions/referral_actions.py
consume_referral ¶
Consume a referral for the rewarded contract.
Creates a discount from the referral for a given month if the conditions are met.
Source code in components/growth/subcomponents/referral/protected/actions/referral_actions.py
create_referral ¶
create_referral(
profile_service,
referred_profile_id,
country_code,
referral_token=None,
referring_partner=None,
)
Create a referral.
Source code in components/growth/subcomponents/referral/protected/actions/referral_actions.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
reward_referring_user ¶
Reward the user who made the referral.
Source code in components/growth/subcomponents/referral/protected/actions/referral_actions.py
ReferralContractInfo
dataclass
¶
ReferralContractInfo(
contract_ref,
contract_id,
start_date,
signed_at,
contractee_type,
is_cancelled,
_eligibility_checker=None,
)
Bases: DataClassJsonMixin
Entity for a referral contract info.
eligible_for_free_month ¶
Check if contract is eligible for free month in the given month.
Source code in components/growth/subcomponents/referral/protected/entities.py
ReferralCreatedEvent
dataclass
¶
ReferralDependency ¶
Bases: ABC
Dependency interface for Referral component to access country-specific functionality.
get_user_id_from_global_profile_id
abstractmethod
¶
Get the user ID from the global profile ID.
ReferralDiscount
dataclass
¶
ReferralDiscount(
country_code,
start_month,
end_month,
amount_for_primary,
amount_for_partner,
amount_for_children,
free_month,
contract_ref,
referral_id,
)
Bases: DataClassJsonMixin
Entity for a referral discount.
ReferralQueries ¶
Queries for the referral.
get_received_referral_for_profile ¶
Get the received referral for a profile.
Source code in components/growth/subcomponents/referral/protected/queries/referral_queries.py
handle_referral_created ¶
Handle the referral created event.
set_app_dependency ¶
Function used to actually inject the dependency class in the component.
Source code in components/growth/subcomponents/referral/dependencies.py
self_serve_feedback ¶
create_self_serve_feedback ¶
Create a new self serve feedback form entry
Source code in components/growth/public/business_logic/self_serve_feedback.py
self_serve_flow ¶
create_self_serve_flow_progress ¶
create_self_serve_flow_progress(
country_code,
flow_type,
language,
alan_partner_code,
referring_user_token,
referring_partner,
user_ref,
commit=True,
)
Create the self-serve flow progress
Source code in components/growth/public/business_logic/self_serve_flow.py
get_multiple_self_serve_flow_progress ¶
Get multiple self-serve flow progress records by ID.
Source code in components/growth/public/business_logic/self_serve_flow.py
get_self_serve_flow_progress ¶
Get the self-serve flow progress
Source code in components/growth/public/business_logic/self_serve_flow.py
update_self_serve_flow_progress ¶
update_self_serve_flow_progress(
self_serve_flow_progress_id,
params=None,
proposal_ref=None,
user_ref=None,
commit=True,
)
Update the self-serve flow progress
Source code in components/growth/public/business_logic/self_serve_flow.py
settings ¶
slack_reporting ¶
components.growth.public.commands ¶
components.growth.public.dependencies ¶
GrowthDependency ¶
Bases: ABC
create_conversation_context
abstractmethod
¶
Implement create_conversation_context
get_company_quote_request_data
abstractmethod
¶
get_company_quote_request_data(
language,
phone_number,
firstname,
lastname,
company_name,
number_of_employees,
qualification,
)
Implement get_company_quote_request_event
Source code in components/growth/public/dependencies.py
get_extra_tags_for_country
abstractmethod
¶
get_inbound_sales_team
abstractmethod
¶
get_intercom_admin_id_from_user_id
abstractmethod
¶
get_prospects_emails_from_phone_number
abstractmethod
¶
get_self_serve_flow_id_from_qualification
abstractmethod
¶
Implement get_self_serve_flow_id_from_qualification
get_user
abstractmethod
¶
get_user_from_email
abstractmethod
¶
get_user_from_intercom_admin_id
abstractmethod
¶
is_admin_sales
abstractmethod
¶
is_request_likely_for_care
abstractmethod
¶
Implement is_request_likely_for_care it should return a tuple with: - a bool if the request is likely for care - a str with the reason if the request is likely for care
Source code in components/growth/public/dependencies.py
register_prospect
abstractmethod
¶
register_prospect(
email,
phone=None,
attribution_survey_source=None,
qualification_raw_company=None,
qualification_raw_individual=None,
qualification_raw_website=None,
)
Implement register_prospect
Source code in components/growth/public/dependencies.py
send_unauthenticated_user_async_message_to_intercom
abstractmethod
¶
Implement send_unauthenticated_user_async_message_to_intercom
get_app_dependency ¶
Get the growth dependency in the current app context
Source code in components/growth/public/dependencies.py
set_app_dependency ¶
Set the growth dependency in the current app context
Source code in components/growth/public/dependencies.py
components.growth.public.entities ¶
growth_setting ¶
inbound_sales_team ¶
InboundSalesTeam
dataclass
¶
Bases: DataClassJsonMixin
Represents an inbound sales team / crew for a specific country
prospect_conversation ¶
ProspectConversation
dataclass
¶
ProspectConversation(
*,
conversation_id,
prospect_type,
prospect_request_type,
assigned_to,
segment
)
Bases: DataClassJsonMixin
Represents a conversation with a prospect in the growth component's assignment scope
quote_request_event ¶
QuoteRequestData
dataclass
¶
QuoteRequestData(
*,
customer_io_event_name,
customer_io_event_attributes,
should_be_sent_to_crm,
quote_details,
self_serve_flow_id
)
Bases: DataClassJsonMixin
components.growth.public.types ¶
codes_and_tags ¶
growth_settings ¶
GrowthSettingEnum ¶
Bases: AlanBaseEnum
Represents the names of all settings in the GrowthSetting table If you need to add a new setting, you should also create a migration script to to insert it into the table
be_backup_inbound_sales_emails
class-attribute
instance-attribute
¶
fr_backup_inbound_sales_emails
class-attribute
instance-attribute
¶
fr_enable_callback_button_on_email_capture_step
class-attribute
instance-attribute
¶
fr_enable_callback_button_on_email_capture_step = (
"fr_enable_callback_button_on_email_capture_step"
)
fr_enable_callback_button_on_first_step
class-attribute
instance-attribute
¶
fr_number_of_daily_email_capture_leads
class-attribute
instance-attribute
¶
fr_number_of_daily_quotes_and_stuck_leads
class-attribute
instance-attribute
¶
fr_warning_in_contact_modal
class-attribute
instance-attribute
¶
inbound_sales_emails_to_exclude
class-attribute
instance-attribute
¶
PUBLIC_GROWTH_SETTINGS
module-attribute
¶
PUBLIC_GROWTH_SETTINGS = [
fr_enable_chat,
fr_warning_in_contact_modal,
fr_enable_callback_button_on_first_step,
fr_enable_callback_button_on_email_capture_step,
]
hubspot ¶
last_origin_type ¶
prospect_request_type ¶
ProspectRequestType
module-attribute
¶
ProspectRequestType = Literal[
"meeting_request",
"callback",
"email",
"chat",
"account_creation_stuck",
"quote_request",
"email_capture",
]