Api reference
components.global_account.public.account_entity ¶
AccountStatus ¶
delete_account_if_it_has_no_entity ¶
Source code in components/global_account/external/account.py
get_account ¶
Source code in components/global_account/external/account.py
get_account_entities ¶
Source code in components/global_account/external/account.py
components.global_account.public.actions ¶
bookmark_account ¶
bookmark_account ¶
Bookmark an account for a specific user. Only creates the bookmark if it doesn't already exist.
Source code in components/global_account/public/actions/bookmark_account.py
unbookmark_account ¶
Remove bookmark for an account for a specific user.
Source code in components/global_account/public/actions/bookmark_account.py
components.global_account.public.builder_prospect ¶
get_builder_prospect_by_ccn_and_siren ¶
Return the CompanyProspect for the given ccn_code and SIREN + NIC if given, or None if not found.
Source code in components/global_account/public/builder_prospect.py
get_company_prospect ¶
get_company_prospect_or_none ¶
Source code in components/global_account/internal/queries/builder_prospect.py
get_company_prospects ¶
Source code in components/global_account/internal/queries/builder_prospect.py
get_or_create_builder_prospects_from_companies ¶
Return a mapping (company_ref -> prospect) for all the provided companies. If the company already has a builder prospect, the existing builder prospect is returned. Otherwise, a new builder prospect is created.
Source code in components/global_account/internal/actions/builder_prospect.py
get_or_create_prospects_from_account_id_and_entities ¶
Fetches all the builder prospects from the account (possibly creates prospects if only comnpanies exist) then returns all the prospects that are referenced by the entities list
Source code in components/global_account/internal/actions/builder_prospect.py
get_or_create_prospects_from_entities ¶
Get or create builder prospects from entities.
- If the entity has a prospect_ref, get the prospect by ID from the DB.
- If the entity has a company_ref:
- get the builder prospect for the company if it exists.
- else create it.
Source code in components/global_account/internal/actions/builder_prospect.py
components.global_account.public.composite_account_repository ¶
CompositeAccountRepository ¶
Bases: AccountRepository
Single AccountRepository that will query across countries.
create_account ¶
Source code in components/global_account/public/composite_account_repository.py
get_account ¶
Iteratively search through all countries and returns the relevant account
Source code in components/global_account/public/composite_account_repository.py
get_full_account ¶
Source code in components/global_account/public/composite_account_repository.py
get_or_create_builder_prospects ¶
Iteratively search through all countries and returns the relevant prospects
Source code in components/global_account/public/composite_account_repository.py
search_accounts ¶
Iteratively search through all countries and returns the relevant accounts
Source code in components/global_account/public/composite_account_repository.py
search_companies ¶
Source code in components/global_account/public/composite_account_repository.py
update_company ¶
Source code in components/global_account/public/composite_account_repository.py
components.global_account.public.entities ¶
builder_prospect_api ¶
BuilderProspectAPISchema
dataclass
¶
BuilderProspectAPISchema(
siren,
name,
ccn_code,
ape_code,
postal_code,
company_creation_year,
number_of_primaries,
country,
franchise_name=None,
alan_account_id=None,
salesforce_account_id=None,
salesforce_opportunity_id=None,
nic=None,
is_from_self_serve=False,
company_ref=None,
)
Bases: DataClassJsonMixin
PatchBuilderProspectAPISchema
dataclass
¶
PatchBuilderProspectAPISchema(
siren=NOT_SET,
name=NOT_SET,
ccn_code=NOT_SET,
ape_code=NOT_SET,
postal_code=NOT_SET,
company_creation_year=NOT_SET,
number_of_primaries=NOT_SET,
franchise_name=NOT_SET,
alan_account_id=NOT_SET,
salesforce_account_id=NOT_SET,
salesforce_opportunity_id=NOT_SET,
nic=NOT_SET,
is_from_self_serve=NOT_SET,
company_ref=NOT_SET,
)
Bases: DataClassJsonMixin
company_prospect ¶
CompanyProspect
dataclass
¶
CompanyProspect(
*,
alan_account_id,
salesforce_account_id=None,
salesforce_opportunity_id=None,
name,
formatted_name,
siren,
nic=None,
ape_code,
ccn_code,
franchise_name,
franchise_ref,
postal_code,
company_creation_year,
number_of_primaries,
is_from_self_serve,
company_ref=None,
id,
country
)
Bases: BaseEntity, DataClassJsonMixin
from_builder_prospect
classmethod
¶
Source code in components/global_account/internal/entities/company_prospect.py
global_builder_prospects ¶
BuilderProspect
dataclass
¶
BuilderProspect(
*,
id,
alan_account_id,
country,
name,
salesforce_account_id=None,
industry_framework_agreement_code=None,
main_business_activity_code=None,
company_identifier,
specific_company_identifier=None,
franchise_name=None,
franchise_ref=None,
postal_code=None,
salesforce_opportunity_id=None,
is_from_self_serve,
creation_year=None,
number_of_primaries=None,
company
)
Bases: DataClassJsonMixin
Either points to a real company (company is not None) or represents a potential company.
industry_framework_agreement_code
class-attribute
instance-attribute
¶
Company
dataclass
¶
Company(
*,
id,
alan_account_id,
country,
name,
salesforce_account_id=None,
franchise_name=None,
franchise_ref=None,
company_identifier,
specific_company_identifier=None,
main_business_activity_code=None,
industry_framework_agreement_code=None,
postal_code=None
)
Bases: DataClassJsonMixin
Represents an actual Company
industry_framework_agreement_code
class-attribute
instance-attribute
¶
proposal_api ¶
ProposalItemAPISchema
dataclass
¶
ProposalItemAPISchema(
builder_product_id=None,
prevoyance_builder_product_id=None,
plan_id=None,
company_ids=list(),
)
Bases: DataClassJsonMixin, DataClassJsonAlanMixin
__post_init__ ¶
Source code in components/global_account/public/entities/proposal_api.py
prevoyance_builder_product_id
class-attribute
instance-attribute
¶
components.global_account.public.enum ¶
global_account_supported_country ¶
mapper ¶
global_account_supported_country ¶
GlobalAccountSupportedCountryMapper ¶
Mapper between GlobalAccountSupportedCountry and AppName
from_salesforce_account
staticmethod
¶
Gets the Country from an SalesforceAccount
Source code in components/global_account/public/enum/mapper/global_account_supported_country.py
to_app_name
staticmethod
¶
Maps a GlobalAccountSupportedCountry to an AppName
Source code in components/global_account/public/enum/mapper/global_account_supported_country.py
components.global_account.public.events ¶
ProposalCreated
dataclass
¶
ProposalCreated(
*,
proposal_id,
health_builder_product_ids,
prevoyance_builder_product_ids,
country
)
Bases: WebhookMessage
The event is triggered when a proposal is created from within offer builder.
components.global_account.public.queries ¶
search_accounts ¶
SearchAccount
dataclass
¶
SearchAccount(
id,
app_name,
name=None,
min_start_date=None,
max_end_date=None,
is_key_account=None,
am_level=None,
is_unmanaged_key_account=None,
owner_name=None,
value_segment=None,
sub_industry=None,
franchise_name=None,
employee_count=None,
signed_total_arr=None,
loss_ratio_credibility=None,
credibility=None,
status=None,
live_prevoyance_contract_count=None,
live_health_contract_count=None,
company_count=None,
has_health_contract=None,
has_prevoyance_contract=None,
bookmarked_by_user_ids=list(),
n_live_primaries=None,
)
Bases: DataClassJsonMixin
This entity is used to expose the search accounts. Aggregated data computed by Turing and refreshed by Airflow using export backend DAG
bookmarked_by_user_ids
class-attribute
instance-attribute
¶
from_model
classmethod
¶
Convert a SQLAlchemy model instance to a SearchAccount instance.
Source code in components/global_account/public/queries/search_accounts.py
live_prevoyance_contract_count
class-attribute
instance-attribute
¶
SearchAccountSortKey ¶
Bases: AlanBaseEnum
Enum defining the possible sort keys for search accounts.
loss_ratio_credibility
class-attribute
instance-attribute
¶
search_accounts ¶
search_accounts(
page=1,
per_page=100,
app_name=None,
name_or_id=None,
account_ids=None,
employees_count_more_than=None,
employees_count_less_than=None,
is_key_account=None,
am_level=None,
owner_name=None,
value_segment=None,
status=None,
min_start_date_after=None,
min_start_date_before=None,
loss_ratio_credibility_more_than=None,
loss_ratio_credibility_less_than=None,
signed_total_arr_more_than=None,
signed_total_arr_less_than=None,
company_count_more_than=None,
company_count_less_than=None,
live_health_contract_count_more_than=None,
live_health_contract_count_less_than=None,
live_prevoyance_contract_count_more_than=None,
live_prevoyance_contract_count_less_than=None,
has_health_contract=None,
has_prevoyance_contract=None,
is_bookmarked_by_user_id=None,
sort_by=None,
sort_desc=False,
)
Search for accounts. Results contains aggregated data computed by Turing.
Source code in components/global_account/public/queries/search_accounts.py
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |