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/packages/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
are_user_reimbursements_blocked ¶
The method will return whether the user's (primary or dependent) reimbursements are blocked.
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_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_pet_insurance_enabled ¶
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
¶
WithdrawalDependency ¶
Port that apps using the withdrawal subcomponent need to implement.
get_withdrawal_state ¶
Return the withdrawal state for one (subject_type, subject_id).
Returns None when the subject does not exist, is not owned by the user, or is not a withdrawable subject for this app.
Source code in components/member_lifecycle/subcomponents/withdrawal/protected/dependencies.py
withdraw ¶
Execute withdrawal for a single item.
Implementations cancel the underlying entity and own the commit. Reason/custom_reason auditing is handled by the action above the dependency, in the same transaction as the cancel.
Source code in components/member_lifecycle/subcomponents/withdrawal/protected/dependencies.py
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
ChildDefinitionRule
dataclass
¶
ChildDefinitionRuleValue ¶
Bases: AlanBaseEnum
child_age_under_21_or_25_if_student
class-attribute
instance-attribute
¶
child_age_under_max_age
class-attribute
instance-attribute
¶
child_benefit_received
class-attribute
instance-attribute
¶
child_disabled_before_age_limit
class-attribute
instance-attribute
¶
child_financially_dependent
class-attribute
instance-attribute
¶
child_fiscally_at_charge
class-attribute
instance-attribute
¶
child_legal_guardianship
class-attribute
instance-attribute
¶
child_not_married_or_in_legal_union
class-attribute
instance-attribute
¶
grandchild_fiscally_at_charge_or_same_address
class-attribute
instance-attribute
¶
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".
WARNING: These values are consumed by frontend/mobile clients Any changes to the values must be reflected there.
CreateDependentPayload
dataclass
¶
CreateDependentPayload(
first_name,
birth_date,
type,
dependent_user_id=None,
last_name=None,
coverage_start_date=None,
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,
pet_species=None,
pet_breed=None,
pet_identification_number=None,
)
DefaultCoverageModuleInfo
dataclass
¶
DependentSpecs
dataclass
¶
DependentSpecs(
dependent_birthdate,
dependent_type,
dependent_coverage_module_name=None,
start_date=None,
pet_breed_key=None,
)
dependent_coverage_module_name
class-attribute
instance-attribute
¶
DependentsAgeBoundaries
dataclass
¶
HealthContractInfo
dataclass
¶
HealthContractInfo(
health_contract_id,
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
¶
PartnerDefinitionRule
dataclass
¶
PartnerDefinitionRuleValue ¶
Bases: AlanBaseEnum
partner_civil_solidarity_pact
class-attribute
instance-attribute
¶
partner_cohabitant_stable_union
class-attribute
instance-attribute
¶
partner_common_law_partner_12_months_conjugal_relationship
class-attribute
instance-attribute
¶
partner_common_law_partner_12_months_conjugal_relationship = "partner_common_law_partner_12_months_conjugal_relationship"
partner_conjugal_partner_12_months_committed_relationship_exceptional_circumstances
class-attribute
instance-attribute
¶
partner_conjugal_partner_12_months_committed_relationship_exceptional_circumstances = "partner_conjugal_partner_12_months_committed_relationship_exceptional_circumstances"
partner_same_address_affiliate_before_65
class-attribute
instance-attribute
¶
partner_same_address_affiliate_before_66
class-attribute
instance-attribute
¶
partner_same_address_affiliate_before_67
class-attribute
instance-attribute
¶
partner_same_address_affiliate_before_retirement_age
class-attribute
instance-attribute
¶
partner_same_address_affiliate_before_retirement_age = (
partner_same_address_affiliate_before_retirement_age
)
partner_same_address_affiliation
class-attribute
instance-attribute
¶
partner_spouse_married
class-attribute
instance-attribute
¶
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,
is_exemption_required,
show_prices_link,
show_provincial_benefits_introduction,
partner_definition_rules,
child_definition_rules,
)
Bases: DataClassJsonMixin
Configuration for the PricesAndConditions component.
RetroactiveAffiliationWindow
dataclass
¶
WaitingPeriod
dataclass
¶
WithdrawalSubjectState
dataclass
¶
WithdrawalSubjectState(
subject_id,
subject_type,
eligible,
window_start=None,
window_end=None,
window_days=None,
ineligibility_reason=None,
)
Bases: DataClassJsonMixin
State of a single withdrawable item as returned by the query path.
window_days mirrors the subject's configured withdrawal-window length (in
days) so user-facing copy can interpolate the count instead of hardcoding
"14". Always populated when the subject exists; None only when the query
path returns no state (404 / no_affordance).
components.member_lifecycle.public.enums ¶
AddDependentSuccessScreenWidgetType ¶
Bases: AlanBaseEnum
Global enum to determine which widget must be displayed in the AddDependentSuccess screen
The wording of the ENUMS matters
- It is used in the frontend screen to pick the right widget to display
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
Currency ¶
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
ExtendedDependentEnrollmentType ¶
Bases: AlanBaseEnum
BeneficiaryEnrollmentType + pet. No primary.
to_beneficiary_enrollment_type ¶
Convert to BeneficiaryEnrollmentType. Raises for pet.
Source code in components/member_lifecycle/public/enums.py
ExtendedEnrollmentType ¶
Bases: AlanBaseEnum
EnrollmentType + pet. Used at the add-dependents boundary.
to_enrollment_type ¶
Convert to EnrollmentType. Raises for pet.
WithdrawalReason ¶
Bases: AlanBaseEnum
Reason picked by the member when triggering a 14-day withdrawal.
Source of truth for the FR copy lives in the front-end design system —
here we only persist the canonical key. other lets the member provide
a free-form custom_reason; for every other value custom_reason is
optional and members may submit it empty.
components.member_lifecycle.public.exceptions ¶
Re-exports of exceptions defined in subcomponents; other components must import from here.
CreateDependentError ¶
Bases: Exception
Business rule refused creation; controller should abort with this status and message.
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/create_dependent/exceptions.py
WithdrawalNotAllowed ¶
Bases: Exception
Re-validation rejected the withdrawal (out of window, consumption, already withdrawn...).
Source code in components/member_lifecycle/subcomponents/withdrawal/protected/errors.py
WithdrawalReasonInvalid ¶
Bases: Exception
The reason picked by the member is not allowed for this subject type.
WithdrawalSubjectNotFound ¶
Bases: Exception
Subject does not exist, is not owned by the user, or is not a withdrawable type.
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.
Source code in components/member_lifecycle/subcomponents/prices/internal/domain/ports/price_provider.py
components.member_lifecycle.public.queries ¶
can_dependent_be_invited_to_create_an_account ¶
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/invite_dependent/queries.py
get_child_definition_rules ¶
Build child definition rules from health contract settings.
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/get_dependent_definition_rules/queries.py
get_partner_definition_rules ¶
Build partner definition rules from health contract settings.
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/get_dependent_definition_rules/queries.py
has_existing_partner ¶
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/beneficiaries/queries.py
has_reached_maximum_number_of_dependents ¶
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/beneficiaries/queries.py
should_show_prices_at_the_end_alert ¶
should_trigger_household_not_declared_notification ¶
Source code in components/member_lifecycle/subcomponents/add_dependents/internal/household_declaration/queries.py
components.member_lifecycle.public.services ¶
create_member_lifecycle_eng_on_call_linear_issue ¶
Create one member_lifecycle on-call Linear issue for a single failed RQ job.
Skips creation when an open issue already contains the RQ job marker (dedup).
Returns:
| Type | Description |
|---|---|
bool
|
True if a new issue was created, False if skipped (duplicate, or dry run). |
Source code in components/member_lifecycle/internal/services/linear.py
create_ticket_for_recently_failed_member_lifecycle_jobs ¶
Create member_lifecycle on-call Linear issues for recently failed ML queue jobs (one per job).
Source code in components/member_lifecycle/internal/services/register_failed_queue_jobs_cli.py
register_failed_member_lifecycle_queue_jobs_cli ¶
Same command on fr_root_commands (flask create_ticket_…) or BE queues (flask queues …).