Api reference
components.member_lifecycle.public.commands ¶
generate_frontend_types_file ¶
generate_frontend_typescript_types_files ¶
Use flask generate_frontend_typescript_types_files --execute to generate the frontend typescript types.
- File: "frontend/modules/member-lifecycle/add-dependents/src/queryTypes.ts"
- Types: all enums and entities
Source code in components/member_lifecycle/public/commands/generate_frontend_types_file.py
components.member_lifecycle.public.dependencies ¶
AddDependentsDependency ¶
AddDependentsDependency defines the interface that apps using the add_dependents subcomponent need to implement
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
can_add_dependents ¶
The method will return True if the user can add dependents
contract_allows_partner ¶
The method will return True if the primary's contract allows to add a partner
create_dependent ¶
The method will create the dependent for the primary user. Returns: The insurance profile ID of the created dependent.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_age_boundaries_by_dependent_type ¶
The method will return the age boundaries of a dependent for the user Boundaries are included, meaning the dependent age should be withing those boundaries, including the boundaries.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_beneficiaries_linked_to_user_on ¶
get_beneficiaries_linked_to_user_on(
user_id,
on_date=None,
enrollment_type=None,
include_future=False,
)
The method will return the beneficiaries linked to the user coverage on a specific date. The beneficiaries contain the primary and their dependents.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_child_account_minimum_age ¶
Returns the minimum age required for a child dependent to have an Alan account. Returns None if child dependents are not allowed to have accounts.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_debt_balance ¶
The method will return the debt balance in cents for the user.
get_default_coverage_module ¶
Returns the default coverage module that will be applied to new dependents
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_dependent_tax_benefit_type ¶
The method will return the dependent tax benefit type if eligible else returns None.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_health_contract_info ¶
The method will return the user's health contract info, including affiliation delay if present
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_household_declaration ¶
The method will return the household declaration data for the user.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_minimum_coverage_months ¶
The method will return the minimum number of months of coverage required for the dependent.
get_past_dependents ¶
This method will return the past dependents of the user, relative to the start date of the current or next affiliation on on_date and, if provided, with a specific birthdate. It will exclude dependents that are active on or after on_date.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_past_dependents_national_identification ¶
The method will return the SSN of a past dependent.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_possible_start_dates ¶
get_possible_start_dates(
user_id,
new_dependent_birth_date,
coverage_start_date_scenario,
at_date=None,
existing_dependent_user_id=None,
)
The method will return the possible coverage start dates for the user.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
get_prices_and_conditions_config ¶
The method will return the features enablement for prices and conditions
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
is_primary_focus_enabled ¶
The method will return whether the primary focus feature is enabled or not.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
require_gender ¶
The method will return whether the add dependent flow requires a gender to be provided.
should_request_payment_method_for_user_subscription ¶
should_request_payment_method_for_user_subscription(
user_id,
on_date,
new_dependent_birth_date=None,
new_dependent_enrollment_type=None,
declared_income_in_cents=None,
)
The method will return whether we should request payment method for the user's subscription.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
upload_identification_certificate_for_user ¶
Upload an identification file for a given user.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
upsert_household_declaration ¶
The method will create the household declaration for the user.
Source code in components/member_lifecycle/subcomponents/add_dependents/protected/dependencies.py
MemberLifecycleDependency ¶
MemberLifecycleDependency defines the interface that apps using the member_lifecycle component need to implement
Source code in components/member_lifecycle/internal/dependencies/member_lifecycle.py
merge_users ¶
The method will merge the source user into the target user and return some logs about the changes
Source code in components/member_lifecycle/internal/dependencies/member_lifecycle.py
NationalIdentification
dataclass
¶
PastDependent
dataclass
¶
set_app_dependency ¶
Sets the member_lifecycle dependency to the app so it can be accessed within this component at runtime
Source code in components/member_lifecycle/internal/dependencies/member_lifecycle.py
components.member_lifecycle.public.entities ¶
AffiliationDelay
dataclass
¶
AgeBoundaries
dataclass
¶
BeneficiaryInfo
dataclass
¶
BeneficiaryInfo(
identification_type,
identification_id,
first_name,
beneficiary_type,
birth_date=None,
user_id=None,
)
Bases: DataClassJsonMixin
CoverageModuleInfo
dataclass
¶
CoverageModuleInfo(
coverage_module_name,
coverages,
is_upgrade,
partner_price=None,
child_price=None,
)
Bases: DataClassJsonMixin
CoverageStartDateScenario ¶
Bases: AlanBaseEnum
Scenarios for determining coverage start date for new dependents - newborn_within_2_months = the dependent is a newborn born within 2 months of the current date - newborn_more_2_months = the dependent is a newborn born more than 2 months of the current date - onboarding_month = the add dependent occurs during the 1st month of the primary coverage (onboarding month) - default_scenario = refers to all other scenarios execpt the ones mentioned above - unique = refers to the others countries than France, where there is only one coverage start date option
The wording of the ENUMS matters
- It is used in the frontend screen to pick the right description
CoverageType ¶
Bases: AlanBaseEnum
CoverageType describes each class of guarantee.
Note: "ambulatory" means "daily care" + "dental".
CreateDependentPayload
dataclass
¶
CreateDependentPayload(
dependent_user_id,
first_name,
last_name,
birth_date,
coverage_start_date,
type,
gender=None,
coverage_module_name=None,
settlement_iban=None,
ssn=None,
referent_ssns=None,
selected_income_bracket_data=None,
income_brackets_data=None,
birth_ranks=None,
supplementary_insurance=False,
)
DefaultCoverageModuleInfo
dataclass
¶
DependentSpecs
dataclass
¶
DependentsAgeBoundaries
dataclass
¶
HealthContractInfo
dataclass
¶
HealthContractInfo(
dependents_participation,
waiting_period,
affiliation_delay,
primary_coverage_start_date,
is_direct_billing,
is_partner_coverage_mandatory,
is_children_coverage_mandatory,
retroactive_affiliation_window,
)
Bases: DataClassJsonMixin
The fields will be None if the information cannot be matched to the expected dataclass.
HouseholdDeclaration
dataclass
¶
IdentificationFlowType ¶
Bases: AlanBaseEnum
Type of identification flow.
NewDependentsPriceBreakdown
dataclass
¶
Price
dataclass
¶
Price(
currency,
amount=None,
min_amount=None,
max_amount=None,
min_discounted_amount=None,
max_discounted_amount=None,
tooltip_keys=None,
tooltip_params=None,
)
Bases: DataClassJsonMixin
Source code in components/member_lifecycle/subcomponents/prices/internal/domain/entities/dependent_price.py
PricesAndConditionsConfig
dataclass
¶
PricesAndConditionsConfig(
child_covered_until_max_age,
membership,
fr_social_security,
be_social_security,
be_fiscally_dependent_age,
has_mandatory_dependents_coverage,
show_prices_link,
)
Bases: DataClassJsonMixin
Configuration for the PricesAndConditions component.
RetroactiveAffiliationWindow
dataclass
¶
WaitingPeriod
dataclass
¶
components.member_lifecycle.public.enums ¶
CoverageStartDateScenario ¶
Bases: AlanBaseEnum
Scenarios for determining coverage start date for new dependents - newborn_within_2_months = the dependent is a newborn born within 2 months of the current date - newborn_more_2_months = the dependent is a newborn born more than 2 months of the current date - onboarding_month = the add dependent occurs during the 1st month of the primary coverage (onboarding month) - default_scenario = refers to all other scenarios execpt the ones mentioned above - unique = refers to the others countries than France, where there is only one coverage start date option
The wording of the ENUMS matters
- It is used in the frontend screen to pick the right description
DependentTaxBenefitType ¶
Bases: AlanBaseEnum
Global enum to determine which tax benefit the dependent is eligible to. The list is expected to evolved with future tax benefits.
The wording of the ENUMS matters
- It is used in the frontend screen to pick the right information to display
NationalIdentificationTypes ¶
Bases: AlanBaseEnum
Types of national identification numbers used across countries.
Each country has its own identification system for social security/healthcare: - ssn: Social Security Number (France - NumΓ©ro de SΓ©curitΓ© Sociale) - nrn: National Registration Number (Belgium - Rijksregisternummer) [future] - nie: Foreigner Identification Number (Spain - NΓΊmero de Identidad de Extranjero) [future] - sin: Social Insurance Number (Canada) [future]
This enum will expand as Alan operates in more countries.
components.member_lifecycle.public.ports ¶
PriceProvider ¶
get_dependents_price_breakdown ¶
Returns the price breakdown for a new dependent. This is used to display the prices when adding a new dependent.