Api reference
components.fr.public.admins ¶
queries ¶
get_account_admins_profile_ids ¶
Get the global_profile_ids of the admins of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id
|
UUID
|
The id of the account. |
required |
Source code in components/fr/public/admins/queries.py
get_company_admins_profile_ids ¶
Get the global_profile_ids of the admins of a company.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
company_id
|
int
|
The id of the company. |
required |
Source code in components/fr/public/admins/queries.py
get_user_can_add_and_refer_company ¶
Source code in components/fr/public/admins/queries.py
components.fr.public.auth ¶
authorization ¶
AuthorizationStrategies ¶
authenticated_with_custom_authorization
class-attribute
instance-attribute
¶
authenticated_with_token_fallback
class-attribute
instance-attribute
¶
authenticated_with_token_fallback_with_custom_authorization
class-attribute
instance-attribute
¶
authenticated_with_token_fallback_with_custom_authorization = (
FrAuthenticatedOrTokenWithCustomAuthorizationStrategy
)
FrAlanerAdminStrategy ¶
FrAuthenticatedOrTokenStrategy ¶
FrAuthenticatedOrTokenStrategy(
token_extractor=None,
token_param_name="token",
schemes=None,
allow_deep_link=False,
)
Bases: FrAuthenticatedStrategy
Support either one pair of param name and token extractor or a scheme of multiple pairs of param name and token extractor.
Source code in components/fr/public/auth/authorization.py
authenticator ¶
Source code in components/fr/public/auth/authorization.py
FrAuthenticatedOrTokenWithCustomAuthorizationStrategy ¶
FrAuthenticatedOrTokenWithCustomAuthorizationStrategy(
token_extractor=None,
token_param_name="token",
schemes=None,
allow_deep_link=False,
)
Bases: FrAuthenticatedOrTokenStrategy
Source code in components/fr/public/auth/authorization.py
FrAuthenticatedStrategy ¶
FrAuthenticatedWithCustomAuthorizationStrategy ¶
Bases: AuthenticatedWithCustomAuthorizationStrategy
Source code in components/fr/public/auth/authorization.py
FrOpenStrategy ¶
FrOwnerOnlyStrategy ¶
queries ¶
mfa ¶
is_mfa_required_for_account_admins ¶
Source code in components/fr/internal/auth/business_logic/queries/mfa.py
is_mfa_required_for_company_admins ¶
This function checks if a french company forced MFA activation for its admins.
Source code in components/fr/internal/auth/business_logic/queries/mfa.py
is_mfa_required_for_company_employees ¶
This function checks if a french company forced MFA activation for its employees.
Source code in components/fr/internal/auth/business_logic/queries/mfa.py
components.fr.public.beneficiary ¶
actions ¶
add_beneficiary_form ¶
create_or_update_add_beneficiary_form ¶
create_or_update_add_beneficiary_form(
policy_id,
enrollment_type,
first_name,
last_name,
birth_date,
ssn,
settlement_iban,
start_date,
referent_ssns,
lang,
)
Source code in components/fr/internal/beneficiary/actions/add_beneficiary_form.py
basic_member_attributes ¶
beneficiary_age
module-attribute
¶
beneficiary_age = MemberAttributeDefinition[int](
name="beneficiary_age",
display_name="Beneficiary age",
description="Age of the beneficiary in years",
getter=_get_beneficiary_age,
raw_type=int,
)
beneficiary_birth_date
module-attribute
¶
beneficiary_birth_date = MemberAttributeDefinition[date](
name="beneficiary_birth_date",
display_name="Beneficiary birth date",
description="Birth date of the beneficiary",
getter=_get_beneficiary_birth_date,
raw_type=date,
formatter=_format_birth_date,
)
beneficiary_enrollment_type
module-attribute
¶
beneficiary_enrollment_type = MemberAttributeDefinition[
EnrollmentType
](
name="beneficiary_enrollment_type",
display_name="Beneficiary enrollment type",
description="Enrollment type of the beneficiary (primary, partner, child)",
getter=_get_beneficiary_enrollment_type,
raw_type=EnrollmentType,
formatter=_format_enrollment_type,
)
beneficiary_full_name
module-attribute
¶
beneficiary_full_name = MemberAttributeDefinition[str](
name="beneficiary_full_name",
display_name="Beneficiary full name",
description="Full name of the beneficiary",
getter=_get_beneficiary_full_name,
raw_type=str,
)
enrollment_end_date
module-attribute
¶
enrollment_end_date = MemberAttributeDefinition[date](
name="enrollment_end_date",
display_name="Enrollment end date",
description="End date of the enrollment",
getter=_get_enrollment_end_date,
raw_type=date,
)
enrollment_start_date
module-attribute
¶
enrollment_start_date = MemberAttributeDefinition[date](
name="enrollment_start_date",
display_name="Enrollment start date",
description="Start date of the enrollment",
getter=_get_enrollment_start_date,
raw_type=date,
)
enrollment_termination_type
module-attribute
¶
enrollment_termination_type = MemberAttributeDefinition[
EnrollmentTerminationType
](
name="enrollment_termination_type",
display_name="Enrollment termination type",
description="Reason for enrollment termination",
getter=_get_enrollment_termination_type,
raw_type=EnrollmentTerminationType,
formatter=_format_enrollment_termination_type,
)
member_attributes ¶
beneficiary_eligibility_extension
module-attribute
¶
beneficiary_eligibility_extension = MemberAttributeDefinition[
BeneficiaryEligibilityExtension
](
name="beneficiary_eligibility_extension",
display_name="Beneficiary eligibility extension",
description="Beneficiary eligibility extension for child enrollments",
getter=_get_beneficiary_eligibility_extension,
raw_type=BeneficiaryEligibilityExtension,
formatter=_format_beneficiary_eligibility_extension,
)
contract_regime
module-attribute
¶
contract_regime = MemberAttributeDefinition[ContractRegime](
name="contract_regime",
display_name="Contract regime",
description="Contract regime (general or Alsace-Moselle)",
getter=_get_contract_regime,
raw_type=ContractRegime,
formatter=_format_contract_regime,
)
is_alan_on_surco
module-attribute
¶
is_alan_on_surco = MemberAttributeDefinition[bool](
name="is_alan_on_surco",
display_name="Is Alan on surco",
description="Whether Alan is on surcomplementaire",
getter=_get_is_alan_on_surco,
raw_type=bool,
)
is_attestation_de_droits_uploaded
module-attribute
¶
is_attestation_de_droits_uploaded = MemberAttributeDefinition[
bool
](
name="is_attestation_de_droits_uploaded",
display_name="Is attestation de droits uploaded",
description="Whether attestation de droits has been uploaded",
getter=_get_is_attestation_de_droits_uploaded,
raw_type=bool,
)
last_date_of_attestation_de_droits
module-attribute
¶
last_date_of_attestation_de_droits = MemberAttributeDefinition[
date
](
name="last_date_of_attestation_de_droits",
display_name="Last date of attestation de droits",
description="Date of latest attestation de droits upload",
getter=_get_last_date_of_attestation_de_droits,
raw_type=date,
)
last_date_of_noemie_connection_request
module-attribute
¶
last_date_of_noemie_connection_request = MemberAttributeDefinition[
date
](
name="last_date_of_noemie_connection_request",
display_name="Last date of noemie connection request",
description="Date of most recent noemie connection request",
getter=_get_last_date_of_noemie_connection_request,
raw_type=date,
)
reimbursement_iban
module-attribute
¶
reimbursement_iban = MemberAttributeDefinition[str](
name="reimbursement_iban",
display_name="Reimbursement IBAN",
description="IBAN used for reimbursement",
getter=_get_reimbursement_iban,
raw_type=str,
)
surcomplementaire_period
module-attribute
¶
surcomplementaire_period = MemberAttributeDefinition[
SurcomplementairePeriodInfo
](
name="surcomplementaire_period",
display_name="Surcomplementaire period",
description="Surcomplementaire period info",
getter=_get_surcomplementaire_period,
raw_type=SurcomplementairePeriodInfo,
formatter=_format_surcomplementaire_period,
)
components.fr.public.billing ¶
business_logic ¶
actions ¶
Public billing actions for the FR component.
mark_invoices_as_sent ¶
Query FR invoices by IDs and mark each as sent.
Source code in components/fr/public/billing/business_logic/actions.py
queries ¶
get_employee_debt_status ¶
Source code in components/fr/internal/billing/business_logic/queries/employee_contract.py
member_attributes ¶
billing_balance
module-attribute
¶
billing_balance = MemberAttributeDefinition[int](
name="billing_balance",
display_name="Billing balance",
description="Contract billing balance in euro cents",
getter=_get_contract_billing_balance_in_euro_cents,
raw_type=int,
formatter=_format_billing_balance,
)
billing_information
module-attribute
¶
billing_information = MemberAttributeDefinition(
name="billing_information",
display_name="Billing information",
description="Detailed billing information including invoices and payments",
getter=_get_billing_information,
raw_type=dict,
formatter=_format_billing_information,
)
components.fr.public.claim_management ¶
api ¶
schedule_update_insurance_profile_informations_cache ¶
schedule_update_insurance_profile_informations_cache(
insurance_profile_id=None,
insurance_profile_ids=None,
priority=None,
)
Schedule the update of the insurance profile information cache for the given insurance profile
Source code in components/fr/public/claim_management/api.py
upload_alan_therapy_invoice_as_insurance_document ¶
upload_alan_therapy_invoice_as_insurance_document(
file,
start_date,
end_date,
operator_comment,
user_id,
paid_amount,
executant_number,
health_professional,
short_code,
excluded_company_ids=None,
)
Upload internally an insurance document for Alan Therapy
Source code in components/fr/public/claim_management/api.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 | |
are_policy_reimbursements_blocked ¶
are_policy_reimbursements_blocked_at_care_date ¶
Source code in components/fr/internal/business_logic/insurance_profile.py
member_attributes ¶
care_event_details_from_entry_point
module-attribute
¶
care_event_details_from_entry_point = MemberAttributeDefinition[
CareEventDetailsForSupportAiAssistant
](
name="care_event_details_from_entry_point",
display_name="Care event details from entry point",
description="Detailed care event info from the conversation entry point",
getter=_get_care_event_details,
raw_type=CareEventDetailsForSupportAiAssistant,
formatter=_format_care_event_details,
)
contact_lenses_forfait_remaining_and_limit
module-attribute
¶
contact_lenses_forfait_remaining_and_limit = MemberAttributeDefinition[
dict[str, RemainingAmountUsage | RemainingCountUsage]
](
name="contact_lenses_forfait_remaining_and_limit",
display_name="Contact lenses forfait remaining and limit",
description="Remaining contact lenses forfait usage and limit",
getter=_get_contact_lenses_forfait_remaining_and_limit,
raw_type=dict,
formatter=_format_remaining_usage_contact_lenses,
)
contact_lenses_pec_requests
module-attribute
¶
contact_lenses_pec_requests = MemberAttributeDefinition[
list[PecRequestAttribute]
](
name="contact_lenses_pec_requests",
display_name="Contact lenses PEC requests",
description="List of contact lenses tiers-payant PEC requests",
getter=_get_contact_lenses_pec_requests,
raw_type=list,
formatter=_format_contact_lenses_pec_requests,
)
contact_lenses_prescription_dates
module-attribute
¶
contact_lenses_prescription_dates = MemberAttributeDefinition[
list[PrescriptionAttribute]
](
name="contact_lenses_prescription_dates",
display_name="Contact lenses prescription dates",
description="List of contact lenses prescription attributes",
getter=_get_contact_lenses_prescription_dates,
raw_type=list,
formatter=_format_prescription_attributes,
)
format_pec_request ¶
Format a PEC request for display.
Source code in components/fr/public/claim_management/member_attributes.py
format_remaining_usage ¶
Format remaining usages dict — single entry returns string, multiple returns dict.
Source code in components/fr/public/claim_management/member_attributes.py
glasses_forfait_remaining_and_limit
module-attribute
¶
glasses_forfait_remaining_and_limit = MemberAttributeDefinition[
dict[str, RemainingAmountUsage | RemainingCountUsage]
](
name="glasses_forfait_remaining_and_limit",
display_name="Glasses forfait remaining and limit",
description="Remaining glasses forfait usage and limit",
getter=_get_glasses_forfait_remaining_and_limit,
raw_type=dict,
formatter=_format_remaining_usage_glasses,
)
glasses_pec_requests
module-attribute
¶
glasses_pec_requests = MemberAttributeDefinition[
list[PecRequestAttribute]
](
name="glasses_pec_requests",
display_name="Glasses PEC requests",
description="List of glasses tiers-payant PEC requests",
getter=_get_glasses_pec_requests,
raw_type=list,
formatter=_format_glasses_pec_requests,
)
glasses_prescription_dates
module-attribute
¶
glasses_prescription_dates = MemberAttributeDefinition[
list[PrescriptionAttribute]
](
name="glasses_prescription_dates",
display_name="Glasses prescription dates",
description="List of glasses prescription attributes",
getter=_get_glasses_prescription_dates,
raw_type=list,
formatter=_format_prescription_attributes,
)
insurance_document_details_from_entry_point
module-attribute
¶
insurance_document_details_from_entry_point = MemberAttributeDefinition[
ParsedDocumentContentForSupportAiAssistant
](
name="insurance_document_details_from_entry_point",
display_name="Insurance document details from entry point",
description="Parsed insurance document details from the conversation entry point",
getter=_get_insurance_document_details,
raw_type=ParsedDocumentContentForSupportAiAssistant,
formatter=_format_insurance_document_details,
)
is_enterprise_overconsumption_pilot_member
module-attribute
¶
is_enterprise_overconsumption_pilot_member = MemberAttributeDefinition[
bool
](
name="is_enterprise_overconsumption_pilot_member",
display_name="Is enterprise overconsumption pilot member",
description="Whether the member is part of the enterprise overconsumption pilot program",
getter=_get_is_enterprise_overconsumption_pilot_member,
raw_type=bool,
)
last_care_date
module-attribute
¶
last_care_date = MemberAttributeDefinition[date](
name="last_care_date",
display_name="Last care date",
description="Date of the most recent care event",
getter=_get_last_care_date,
raw_type=date,
)
last_date_of_contact_lenses_purchase
module-attribute
¶
last_date_of_contact_lenses_purchase = MemberAttributeDefinition[
date
](
name="last_date_of_contact_lenses_purchase",
display_name="Last date of contact lenses purchase",
description="Date of last contact lenses purchase via TP",
getter=_get_last_date_of_contact_lenses_purchase,
raw_type=date,
)
last_date_of_glasses_purchase
module-attribute
¶
last_date_of_glasses_purchase = MemberAttributeDefinition[
date
](
name="last_date_of_glasses_purchase",
display_name="Last date of glasses purchase",
description="Date of last glasses purchase via TP",
getter=_get_last_date_of_glasses_purchase,
raw_type=date,
)
previous_glasses_purchase_date_from_previous_insurer
module-attribute
¶
previous_glasses_purchase_date_from_previous_insurer = MemberAttributeDefinition[
date
](
name="previous_glasses_purchase_date_from_previous_insurer",
display_name="Previous glasses purchase date from previous insurer",
description="Date of last glasses purchase recorded from previous insurer form",
getter=_get_previous_glasses_purchase_date_from_previous_insurer,
raw_type=date,
)
quote_document_details_from_entry_point
module-attribute
¶
quote_document_details_from_entry_point = MemberAttributeDefinition[
QuoteDocumentInfo
](
name="quote_document_details_from_entry_point",
display_name="Quote document details from entry point",
description="Quote document details from the conversation entry point",
getter=_get_quote_document_details,
raw_type=QuoteDocumentInfo,
)
teletransmission_status
module-attribute
¶
teletransmission_status = MemberAttributeDefinition[
TeletransmissionStatusInfo
| list[TeletransmissionStatusInfo]
](
name="teletransmission_status",
display_name="Teletransmission status",
description="Teletransmission status for the enrollment",
getter=_get_teletransmission_status,
raw_type=TeletransmissionStatusInfo,
formatter=_format_teletransmission_status,
)
components.fr.public.clinic ¶
adapter ¶
FrClinicAdapter ¶
Bases: ClinicAdapter
clinic_consent_ai_publish_date
class-attribute
instance-attribute
¶
create_external_user ¶
Create an external teleconsultation user profile with onboarding data for FR.
Source code in components/fr/public/clinic/adapter.py
get_app_base_user_data ¶
Source code in components/fr/public/clinic/adapter.py
get_app_user_available_health_services ¶
Source code in components/fr/public/clinic/adapter.py
get_app_user_data ¶
Source code in components/fr/public/clinic/adapter.py
get_booking_session_package ¶
Source code in components/fr/public/clinic/adapter.py
get_coverage_status ¶
Source code in components/fr/public/clinic/adapter.py
get_inactive_profile_ids_since ¶
Return profile IDs inactive for the given period in FR.
Source code in components/fr/public/clinic/adapter.py
get_inactive_user_ids_since ¶
Return app user IDs inactive for the given period in FR.
Source code in components/fr/public/clinic/adapter.py
get_last_active_id_verification_request_for_user ¶
FR implementation of getting the last active ID verification request for a user.
Source code in components/fr/public/clinic/adapter.py
get_orientation_survey_url ¶
has_access_to_orientation_call ¶
has_app_user_permission ¶
Source code in components/fr/public/clinic/adapter.py
is_app_user_admin_of_company ¶
Source code in components/fr/public/clinic/adapter.py
is_orientation_session_mandatory ¶
release_date_of_conversations_created_for_therapy_sessions
class-attribute
instance-attribute
¶
request_id_verification_request_for_user ¶
FR implementation of getting or requesting ID verification for a user.
Source code in components/fr/public/clinic/adapter.py
should_request_id_verification_for_user ¶
FR implementation of checking if ID verification should be requested for a user. We request ID verification for internal consultation if: - The feature flag "request_id_verification_for_internal_consultation" is enabled for the user - The user does not have an active ID verification request - The user's identity is not validated
Source code in components/fr/public/clinic/adapter.py
therapy_refundable_cancellation_limit_in_hours ¶
update_app_user_phone ¶
Source code in components/fr/public/clinic/adapter.py
update_app_user_ssn ¶
upload_invoice_as_insurance_document ¶
Source code in components/fr/public/clinic/adapter.py
user_has_24_hour_response_guarantee ¶
Source code in components/fr/public/clinic/adapter.py
clinic_eligibility ¶
This module contains the query to get the current or upcoming period of eligibility to the clinic restricted services.
NOTE: the logic could be reused by other services than the Clinic, provided the country-specific rules are the same. If yes, feel free to rename the file and query to a more generic name.
get_coverage_status ¶
Return the start and optionally the end date of the current or upcoming period of eligibility to the clinic restricted services.
Source code in components/fr/public/clinic/clinic_eligibility.py
guarantee ¶
THERAPY_SESSION_COMPANY_PRICE_IN_CENTS
module-attribute
¶
get_therapy_sessions_guarantee_package ¶
Get the therapy sessions guarantee data for a user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
int
|
The user ID |
required |
Returns:
| Type | Description |
|---|---|
BookingSessionPackage
|
The therapy sessions package |
Source code in components/fr/public/clinic/guarantee.py
get_therapy_sessions_reimbursed_data ¶
Get the therapy sessions reimbursed for a user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
guarantees
|
list[CoverageGuarantee]
|
The user guarantees |
required |
insurance_profile_id
|
int
|
The insurance profile ID |
required |
app_user_id
|
str
|
The user ID |
required |
Source code in components/fr/public/clinic/guarantee.py
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 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 | |
get_user_coverage_payload ¶
Source code in components/fr/public/clinic/guarantee.py
id_verification ¶
convert_user_data_id_verification_request_user_info ¶
Converts UserData to IDVerificationRequestUserInfo for FR.
Source code in components/fr/public/clinic/id_verification.py
create_first_name_with_additional_first_names ¶
Creates a first name string that includes additional first names if provided.
Source code in components/fr/public/clinic/id_verification.py
internal_teleconsultation ¶
app_user_has_access_to_internal_teleconsultation ¶
Check if the app user has access to internal teleconsultation.
Source code in components/fr/public/clinic/internal_teleconsultation.py
livi ¶
actions ¶
enable_telemedicine_with_livi ¶
Enables telemedicine (with Livi) for a user by adding them to the Livi system. :param user_id: :return: True or False indicating success
Source code in components/fr/public/clinic/livi/actions.py
forcefully_reenable_telemedicine_with_livi ¶
Forcefully re-enables telemedicine (with Livi) for a user by adding them to the Livi system. This is only allowed if the user has previously opted in for telemedicine. :param user_id: :return: True or False indicating success
Source code in components/fr/public/clinic/livi/actions.py
commands ¶
clinic_livi
module-attribute
¶
clinic_livi = AppGroup(
name="clinic_livi",
help="All commands related to Livi in the scope of the clinic (billing livi, user management, etc)",
)
remove_uncovered_users_from_livi ¶
Removes users who have opted in to Livi telemedicine partnership but do not have active insurance coverage.
Source code in components/fr/public/clinic/livi/commands.py
queries ¶
get_opted_in_users_without_active_enrollments ¶
Return Livi opted-in users who do not have any active enrollments as of today.
Ordering: by User.id ascending.
Source code in components/fr/public/clinic/livi/queries.py
is_user_eligible_for_telemedicine_with_livi ¶
Checks if a user is eligible for telemedicine with Livi based on the presence of an SSN in their insurance profile. :param user_id: :return: True or False
Source code in components/fr/public/clinic/livi/queries.py
components.fr.public.company ¶
queries ¶
get_account_id_for_fr_company ¶
Return the account_id for a given FR company, raises the company doesn't exist.
Source code in components/fr/internal/business_logic/company/queries/company.py
get_all_franchises ¶
get_company_ids_from_account ¶
Source code in components/fr/internal/business_logic/account/queries/account.py
get_default_company_id_for_user ¶
Source code in components/fr/internal/business_logic/company/queries/company.py
components.fr.public.contract ¶
member_attributes ¶
company_name
module-attribute
¶
company_name = MemberAttributeDefinition[str](
name="company_name",
display_name="Company name",
description="Company contractee name",
getter=_get_company_name,
raw_type=str,
)
contract_end_date
module-attribute
¶
contract_end_date = MemberAttributeDefinition[date](
name="contract_end_date",
display_name="Contract end date",
description="Health contract end date",
getter=_get_contract_end_date,
raw_type=date,
)
contract_has_madelin_attestation_available
module-attribute
¶
contract_has_madelin_attestation_available = MemberAttributeDefinition[
bool
](
name="contract_has_madelin_attestation_available",
display_name="Madelin attestation available",
description="Whether madelin attestation is available for previous year",
getter=_get_contract_has_madelin_attestation_available,
raw_type=bool,
)
contract_start_date
module-attribute
¶
contract_start_date = MemberAttributeDefinition[date](
name="contract_start_date",
display_name="Contract start date",
description="Health contract start date",
getter=_get_contract_start_date,
raw_type=date,
)
contract_type
module-attribute
¶
contract_type = MemberAttributeDefinition[ContractPlanInfo](
name="contract_type",
display_name="Contract type",
description="Contract plan type and segment",
getter=_get_contract_type,
raw_type=ContractPlanInfo,
formatter=_format_contract_type,
)
has_income_based_children_discount_rules
module-attribute
¶
has_income_based_children_discount_rules = MemberAttributeDefinition[
bool
](
name="has_income_based_children_discount_rules",
display_name="Has income-based children discount rules",
description="Whether contract has income-based children discount rules",
getter=_get_has_income_based_children_discount_rules,
raw_type=bool,
)
health_contract_coverage
module-attribute
¶
health_contract_coverage = MemberAttributeDefinition[
HealthContractCoverageInfo
](
name="health_contract_coverage",
display_name="Health contract coverage",
description="Health contract coverage participation info",
getter=_get_health_contract_coverage,
raw_type=HealthContractCoverageInfo,
formatter=_format_health_contract_coverage,
)
health_contract_status
module-attribute
¶
health_contract_status = MemberAttributeDefinition[
HealthContractStatusInfo
](
name="health_contract_status",
display_name="Health contract status",
description="Health contract status with dates",
getter=_get_health_contract_status,
raw_type=HealthContractStatusInfo,
formatter=_format_health_contract_status,
)
individual_plan_name
module-attribute
¶
individual_plan_name = MemberAttributeDefinition[str](
name="individual_plan_name",
display_name="Individual plan name",
description="Individual plan display name",
getter=_get_individual_plan_name,
raw_type=str,
)
is_direct_billing
module-attribute
¶
is_direct_billing = MemberAttributeDefinition[bool](
name="is_direct_billing",
display_name="Is direct billing",
description="Whether contract uses direct billing",
getter=_get_is_direct_billing,
raw_type=bool,
)
is_direct_billing_of_options
module-attribute
¶
is_direct_billing_of_options = MemberAttributeDefinition[
bool
](
name="is_direct_billing_of_options",
display_name="Is direct billing of options",
description="Whether contract options use direct billing",
getter=_get_is_direct_billing_of_options,
raw_type=bool,
)
plan_number_of_options
module-attribute
¶
plan_number_of_options = MemberAttributeDefinition[int](
name="plan_number_of_options",
display_name="Plan number of options",
description="Number of options in current plan",
getter=_get_plan_number_of_options,
raw_type=int,
)
prevoyance_contract_start_date
module-attribute
¶
prevoyance_contract_start_date = MemberAttributeDefinition[
date
](
name="prevoyance_contract_start_date",
display_name="Prevoyance contract start date",
description="Start date of first active prevoyance contract",
getter=_get_prevoyance_contract_start_date,
raw_type=date,
)
option_member_attributes ¶
Member attribute definitions for FR contract option attributes.
contract_option
module-attribute
¶
contract_option = MemberAttributeDefinition[int](
name="contract_option",
display_name="Contract option",
description="Subscribed option number",
getter=_get_contract_option,
raw_type=int,
)
contract_option_end_date
module-attribute
¶
contract_option_end_date = MemberAttributeDefinition[date](
name="contract_option_end_date",
display_name="Contract option end date",
description="Option contract end date",
getter=_get_contract_option_end_date,
raw_type=date,
)
contract_option_info
module-attribute
¶
contract_option_info = MemberAttributeDefinition[
ContractOptionStatus
](
name="contract_option_info",
display_name="Contract option info",
description="Contract option subscription status",
getter=_get_contract_option_info,
raw_type=ContractOptionStatus,
formatter=_format_contract_option_info,
)
contract_option_start_date
module-attribute
¶
contract_option_start_date = MemberAttributeDefinition[
date
](
name="contract_option_start_date",
display_name="Contract option start date",
description="Option contract start date",
getter=_get_contract_option_start_date,
raw_type=date,
)
queries ¶
health_contracts ¶
get_eligible_health_contract ¶
The eligibility relationship is based on contract population and employment details.
For the eligibility to be considered, the contract and employment must NOT be cancelled. Also, contracts must be signed.
Source code in components/fr/internal/business_logic/contract/queries/health_contracts_backend/query_api.py
get_health_contract_information ¶
Source code in components/fr/internal/business_logic/contract/queries/health_contracts.py
is_health_contract_plan_with_madelin ¶
Source code in components/fr/internal/business_logic/contract/queries/health_contracts.py
income ¶
get_dependent_income_brackets_for_subscriptions ¶
Get dependent income brackets for multiple subscriptions from contract discount rules.
This function extracts income brackets from the discount rules associated with each contract. It filters for discounts that are valid on the given date and converts discount rule income brackets to IncomeBracketEntity objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ids
|
list[int]
|
List of subscription IDs to get dependent brackets for |
required |
on_date
|
date
|
The date to check the income brackets against |
required |
Returns: dict[int, list[IncomeBracketEntity]]: Mapping of subscription_id to dependent brackets
Source code in components/fr/internal/contract/queries/income.py
get_income_brackets_for_subscriptions ¶
Returns income brackets for multiple subscriptions on a specific date. This function is optimized to avoid N+1 queries by batching database operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ids
|
list[int]
|
List of subscription IDs to get income brackets for |
required |
on_date
|
date
|
The date to check the income brackets against |
required |
for_target
|
Optional[IncomeBracketTarget]
|
Optional target for which the income brackets are requested |
None
|
Returns: dict[int, list[IncomeBracketEntity]]: Mapping of subscription_id to income brackets Only includes subscriptions that have income brackets
Source code in components/fr/internal/contract/queries/income.py
get_member_type_for_user_on ¶
Source code in components/fr/internal/contract/queries/income.py
get_option_income_brackets_for_subscriptions ¶
Get option income brackets for multiple subscriptions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ids
|
list[int]
|
List of subscription IDs to get option brackets for |
required |
on_date
|
date
|
The date to check the income brackets against |
required |
Returns: dict[int, list[IncomeBracketEntity]]: Mapping of subscription_id to option brackets
Source code in components/fr/internal/contract/queries/income.py
components.fr.public.customer_health_partner ¶
get_admin_traits ¶
get_admin_traits_to_notify ¶
Return the list of AdminTraits for admins who should be notified about the well-being assessment report.
Source code in components/fr/public/customer_health_partner/get_admin_traits.py
components.fr.public.data_retention ¶
queries ¶
get_inactive_profile_ids_since ¶
Return global profile IDs that have been inactive for the given number of years.
"Inactive" means all enrollments are either cancelled before the cutoff or ended before the cutoff.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inactive_number_of_years
|
int
|
Number of years of inactivity threshold |
required |
Returns:
| Type | Description |
|---|---|
list[UUID]
|
List of global profile IDs (UUID) that have been inactive |
Source code in components/fr/public/data_retention/queries.py
get_inactive_user_ids_since ¶
Return app user IDs that have been inactive for the given number of years.
"Inactive" means all enrollments are either cancelled before the cutoff or ended before the cutoff.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inactive_number_of_years
|
int
|
Number of years of inactivity threshold |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
List of FR app user IDs (str) that have been inactive |
Source code in components/fr/public/data_retention/queries.py
components.fr.public.demo_account ¶
components.fr.public.dependents ¶
declare_dependent_status ¶
Dependents
dataclass
¶
get_user_declared_dependents_on_date ¶
Source code in components/fr/internal/dependents/business_logic/queries/dependents.py
update_user_dependents ¶
Source code in components/fr/internal/dependents/business_logic/actions/dependents.py
components.fr.public.document_parsing ¶
classify_document_category ¶
classify_insurance_document_category ¶
Classify an insurance document based on its transcription
Source code in components/fr/public/document_parsing/classify_document_category.py
entities ¶
errors ¶
queries ¶
document_category ¶
get_document_categories ¶
Get the list of document categories with display info for document in France For now we only return categories that are handled by the new parsing tool return: list[DocumentCategoryDisplayInfo]
Source code in components/fr/public/document_parsing/queries/document_category.py
get_document_category_label ¶
Retrieve the label for the given document category return: string
Source code in components/fr/public/document_parsing/queries/document_category.py
document_transcription ¶
get_best_possible_transcription ¶
get_best_possible_transcription(
document,
min_text_len=0,
require_geometry=False,
use_transcription_cache=False,
transcribers_priority=None,
)
Get the best possible transcription of a document.
Source code in components/fr/public/document_parsing/queries/document_transcription.py
helpers ¶
HEALTH_DOCUMENT_UPLOAD_URL
module-attribute
¶
REJECTION_BODY_FOR_USER
module-attribute
¶
REJECTION_BODY_FOR_USER = {'default_message': {unreadable: f'🧐 Nous ne parvenons pas à lire les informations sur ce document.
👉 Nous vous invitons à nous le transférer à nouveau :
- dans un format standard type (.JPEG, .PNG ou .PDF),
- En vous assurant que l'image est nette et que la qualité est suffisante.
Transférer une nouvelle version du document :{HEALTH_DOCUMENT_UPLOAD_URL}
', unusable_partial_document: f'🤔 Le document envoyé n'est pas complet. Des informations sont donc manquantes pour pouvoir estimer votre remboursement.
👉 Nous vous invitons à nous le renvoyer dans son intégralité (toutes les pages, chaque page entièrement visible).
💁 Dans le cas d'un décompte de soins, vous pouvez le télécharger depuis le site de la Sécurité Sociale, rubrique "Mes paiements" en cliquant sur "Télécharger un décompte" (la petite flèche située à droite des frais de santé concernés).
Transférer une nouvelle version du document : f{HEALTH_DOCUMENT_UPLOAD_URL}', duplicate: "🤔 On dirait que ce document est déjà en notre possession.\n\n👉 Si c'est une erreur, vous pouvez nous renvoyer le bon document, nous le traiterons rapidement.", beneficiary_not_covered: "🤔 On dirait que ce document concerne un bénéficiaire qui n'est pas couvert par Alan.\n\n👉 Nous ne pouvons donc pas procéder au remboursement.", insufficent_info_for_parsing: "🤔 Le document ne contient pas toutes les informations pour estimer votre remboursement. Il y manque :\n\n- Nom du bénéficiaire\n- Nom du professionnel de santé\n- Numéro d'inscription au registre ADELI du professionnel de santé\n- Type de soin / consultation\n- Prix de l'acte (pour chacun des actes séparément)\n- Base de remboursement de la Sécurité sociale ou BRSS (pour chacun des actes séparément)\n- Répartition du dépassement d'honoraires (sur chacun des actes)\n- Code de regroupement pour chacun des actes mentionnés\n- Code de regroupement pour chacun des éléments de l'équipement optique afin que nous puissions identifier la complexité de vos verres et appliquer la garantie correspondante\n- Date de chaque soin / consultation- Décompte complet et détaillé correspondant\n- Facture acquittée à la réception du colis\n- Devis initial avec les bases des actes envisagés\n- Type de soins ou facture détaillée correspondante\n- Si l'intervention porte sur les deux yeux ou un seul oeil (si oui, lequel ?)\n- Décompte complet et détaillé des soins remboursés, accompagné de ce document\n- Certains codes de regroupements ou codes actes apparaissant dans le document sont périmés et ne doivent plus être utilisés\n\n😀 Cependant sachez qu'en général, nous n'avons pas besoin de facture ! Si votre télétransmission est activée, et que votre soin est couvert par la Sécurité sociale, nous devrions recevoir les infos directement de leur part. Toutefois, si vous trouvez le délai trop long (> 15 jours), vous gardez bien sûr la possibilité :\n- de vérifier sur votre compte Améli si le remboursement a déjà été fait par la Sécurité sociale : si oui, vous pouvez nous transmettre le décompte à la place,\n- et, à défaut, de contacter le professionnel de santé pour savoir s'il a bien fait la déclaration de son côté", non_EU_prescription: "🤔 On dirait que ce document est une ordonnance obtenue en dehors de l'Union Européenne.\n\n👉 Nous acceptons uniquement les ordonnances venant des pays de l'Union Européenne.\n\nTransférer une nouvelle version du document : https://alan.com/app/dashboard?documentUploader=claim", other_insurer_decompte_100: '🧐 Nous ne pouvons pas effectuer de remboursement complémentaire car les soins ont déjà été intégralement pris en charge par votre complémentaire principale. Merci de nous transmettre uniquement des documents pour lesquels il reste des frais à votre charge.', cares_received_abroad: '😎 Alan couvre les soins des séjours à l’étranger sur la base de remboursement de la Sécurité Sociale française.\n\n👉 Pensez donc à conserver l’ensemble des factures acquittées et des justificatifs de paiement lors des soins effectués hors de France.\nEnsuite, adressez ces factures accompagnées du formulaire S3125 « Soins reçus à l’étranger », à votre caisse d’assurance maladie.\n\nVous trouverez ce document sur le site Ameli : https://www.ameli.fr/sites/default/files/formualires/221/s3125.pdf\n\nNous récupérerons ensuite les informations de la Sécurité Sociale (télétransmission ou envoi du décompte de votre part)', secu_decompte_100: '🧐 Nous ne pouvons pas effectuer de remboursement complémentaire car les soins ont déjà été intégralement pris en charge par la sécurité sociale. Merci de nous transmettre uniquement des documents pour lesquels il reste des frais à votre charge.', ask_paid_invoice: f'🤔 Le document indique une demande de règlement de votre part.
👉 Nous vous invitons à nous transférer la facture acquittée (parfois appelée quittance ou bordereau).
Vous avez également la possibilité de nous transférer un décompte de Sécu (si possible au format .PDF pour un traitement automatique ultra-rapide !).
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', missing_mt_or_dmt: '🤔 Le document ne contient pas toutes les informations pour estimer votre remboursement.\n\n👉 Nous vous invitons à renseigner le DMT/MT en cliquant sur le bouton ci-dessous ou à nous renvoyer une version contenant les informations suivantes :\n- Code MT ou "Mode de traitement". Ce mode est un code utilisé par l\'Assurance Maladie pour identifier la nature du soin;\n- Code DMT ou "Discipline Médico-tarifaire". Cette discipline est utilisée dans le contexte hospitalier, et permet de caractériser l\'activité de l\'unité médicale ou du service qui vous a fourni le soin.\n\n☎️ Ces informations vous seront fournies en général par l\'hôpital, nous vous invitons à les contacter directement.', etiopathe: "😔 Nous ne pouvons pas couvrir ces soins.\n\n👉 En effet nous ne remboursons les séances d'étiopathie que lorsqu’elles sont dispensées par un professionnel enregistré à l'Institut Français d’Étiopathie.", kine_invoice_without_mezieres: "🤗 Nous avons bien reçu votre facture de kinésithérapie. Elle n'est pas nécessaire pour vous rembourser ! En effet, nous remboursons les actes de kinésithérapie à réception des informations de la Sécurité Sociale.\n\n👉 Si la télétransmission est active, nous devrions recevoir automatiquement ces informations, et nous pourrons calculer votre remboursement dans la foulée.\nSi la sécurité sociale vous a déjà remboursé et que la télétransmission tarde à arriver ou qu’elle est inactive, transférez-nous votre décompte Améli reprenant ces soins depuis votre application Alan.", hospital_receipt: '🤗 Nous avons bien le reçu de paiement pour vos frais hospitaliers.\n\n👉 Ce seul document ne nous permet pas de traiter votre dossier. Si vos soins ont eu lieu en :\nCLINIQUE PRIVEE :\n- Nous avons besoin du bordereau de facturation détaillé acquitté : celui-ci reprend l\'intégralité de vos frais hospitaliers et est à demander au secrétariat de l\'établissement dans lequel vous avez reçu les soins. Sans ce document, nous ne pourrons malheureusement pas traiter votre dossier.\nHOPITAL PUBLIC :\n- Nous avons besoin de l\'avis des sommes à payer détaillé (recto et verso s\'il y en a un).\n- Cependant, dans le cas où vous voyez déjà des soins hospitaliers en attente de traitement depuis votre compte Alan (frais de séjour, consultation anesthésiste à l\'hôpital, consultation chirurgien à l\'hôpital, etc.), n\'hésitez pas à nous contacter afin que nous puissions manuellement rapprocher les informations entre-elles.\n\nN\'hésitez pas à consulter <a href=\'https://alan.com/app/helpV2/a_Mon-remboursement-na-pas-ete-effectue-pour-mes-frais-dhopital\' target="_blank">cet article de notre centre d\'aide</a> pour y voir plus clair', laboratory_invoice: "🤗 Nous avons bien reçu votre facture d'analyses en laboratoire. Elle n'est pas nécessaire pour vous rembourser ! En effet, nous remboursons les actes de laboratoire à réception des informations de la Sécurité Sociale.\n\n👉 Si la télétransmission est active, nous devrions recevoir automatiquement ces informations, et nous pourrons calculer votre remboursement dans la foulée.\nSi la sécurité sociale vous a déjà remboursé et que la télétransmission tarde à arriver ou qu’elle est inactive, transférez-nous votre décompte Améli reprenant ces soins depuis votre application Alan.", titre_de_recette: "🤔 Le document indique que vous avez payé l'intégralité des soins.\n\n👉 Nous vous invitons à envoyer ce document à votre Caisse de Sécurité sociale afin de vous faire rembourser la part qu'ils vous doivent.\n\nLes informations nécessaires à votre remboursement par Alan seront alors disponibles.", acupuncture: '😔 Nous ne pouvons pas couvrir ces soins.\n\n👉 En effet nous ne remboursons les séances d’acupuncture que lorsqu’elles sont dispensées par un médecin diplômé, une sage-femme ou un dentiste (et seulement dans le cas où votre couverture Alan inclut ce type de soin).\n\nTransférer une nouvelle version du document : https://alan.com/app/dashboard?documentUploader=claim', alternative_medicine_quantity_limit_reached: '🤔 Le document ne contient pas toutes les informations pour estimer votre remboursement.\n\n👉 Nous vous invitons à nous renvoyer une version contenant les informations suivantes :\n\n- Date à laquelle chaque soin a été réalisé\n\nTransférer une nouvelle version du document : https://alan.com/app/dashboard?documentUploader=claim', quittance_100: '🤔 Nous avons bien pris connaissance de votre document, et il semblerait que vous ayez réglé l’intégralité de la somme. Vous devez donc l’envoyer à la Sécurité sociale, elle en a besoin pour vous rembourser.\n\n👉 Une fois que nous aurons reçu les informations de remboursements de la part de la Sécu, nous serons en mesure de vous rembourser à notre tour.', hospi_addressed_alan: "🧐 Nous ne pouvons pas vous rembourser cette facture car celle-ci est adressée à Alan.\n\nCela signifie donc que vous n'avez rien réglé. L'établissement doit envoyer la facture à Almérys (notre partenaire de tiers-payant).\n\nNous vous invitons donc à contacter l'établissement afin de leur faire part de cette information.", estimation_already_sent: f'🤭 On dirait que notre estimation vous à déjà été transmis.
👉 Si c’est une erreur, vous pouvez nous renvoyer le bon document. On s’en occupera rapidement!
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}
', almerys_PEC_rejected: "🤔 Ce document indique qu'une prise en charge a été effectuée auprès d'Almérys et que celle-ci a été rejetée.\n\n 👉 En effet, conformément au refus délivré par Almerys, votre forfait est épuisé et nous ne pouvons donc intervenir.\n\n Si vous avez des questions au sujet de vos forfait, n'hésitez pas à nous contacter directement depuis votre espace Alan.", almerys_PEC_request: f'🤔 Ce document indique qu'une demande de prise en charge a été effectuée auprès d'Almérys. Ce document ne nous est pas destiné et ne nous permet pas de vous rembourser.
👉 Si vous avez réglé des frais, nous vous invitons à nous adresser la facture acquittée.
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', arret_de_travail: '🤭 Ce document ne semble pas être lié à un remboursement de soins.\n\n 👉 Si vous souhaitez demander le versement d\'indemnités complémentaires, vous pouvez ajouter ce document depuis la page principale de votre compte Alan sur ordinateur, en sélectionnant l\'onglet "Prévoyance" au centre de l\'écran.\n Si vous ne voyez pas d’onglet “Prévoyance” sur votre espace, c’est peut-être que votre employeur n’a pas souscrit de contrat de Prévoyance avec nous, ou que le dossier d’arrêt de travail n’est pas encore ouvert : dans les deux cas, nous vous inviter à vérifier tout cela avec lui !\n Si vous êtes en portabilité, nous vous invitons à nous contacter pour ouvrir votre dossier.', feuille_de_soins: '😑 Nous avons bien pris connaissance de votre feuille de soin. Il est important de l’envoyer uniquement à la Sécurité sociale, elle en a besoin pour vous rembourser.\n 👉 Une fois votre soin effectué et le remboursement de la Sécu fait, toutes les informations nécessaires seront disponibles pour qu’Alan vous rembourse. Plus besoin de nous envoyer de feuille de soin.', french_state_payment_attestation: " Nous avons bien reçu votre attestation de paiement. Elle n'est pas nécessaire pour vous rembourser ! Si ce n'est pas déjà fait, envoyez-nous le bordereau de facturation acquitté pour ces soins.\n\n 👉 Si vous avez reçu une demande de notre part pour valider que vous avez avancé les soins, merci de valider cela directement sur la page du soin correspondant dans l'application. Si vous n'avez reçu aucune demande de notre part, on est bons ! 👌", hospi_PEC_request: '🤔 Ce document est une demande de prise en charge pour des frais d’hospitalisation.\n\n 👉 Vous pouvez à tout moment et en toute autonomie effectuer votre demande depuis votre compte.\n Depuis un ordinateur :\n - Rendez-vous sur votre espace perso et cliquez en bas à gauche sur “Séjour à l’hôpital”.\n - Une petite explication sur les conditions d’une prise en charge s’affiche, avec le bouton “Demander une prise en charge”.\n - Cliquez dessus et remplissez le formulaire !\n Depuis l’application mobile Alan :\n - Depuis l’onglet “Demandes” (en bas de l’écran), cliquez sur “Séjour à l’hôpital”.', indemnite_journalieres: '🤭 Ce document ne semble pas être lié à un remboursement de soins.\n\n 👉 S\'il s’agit pour vous de justifier de l\'indemnisation de votre arrêt de travail par la Sécu, dans le but de demander le versement de vos indemnités complémentaires, vous pouvez ajouter ce document depuis la page principale de votre compte Alan sur ordinateur, en sélectionnant l\'onglet "Prévoyance" au centre de l\'écran.\n Si vous ne voyez pas d’onglet “Prévoyance” sur votre espace depuis un ordinateur, c’est peut-être que votre employeur n’a pas souscrit de contrat de Prévoyance avec nous, ou qu\'il n\'a pas encore ouvert le dossier d’arrêt de travail : dans les deux cas, nous vous inviter à vérifier tout cela avec lui !\n\n 👉 S\'il s’agit de justifier du maintien de votre portabilité, vous pouvez ajouter ce document, toujours depuis la page principale de votre compte Alan sur ordinateur, en cliquant sur "Couverture - Ex-salarié".', payment_card_ticket: "🤗 Nous avons bien reçu votre ticket de carte bleue. Il n'est pas nécessaire pour vous rembourser ! Si ce n'est pas déjà fait et que le soin effectué n'est pas couvert par la Sécurité sociale, envoyez-nous la facture détaillée et acquittée.\n\n 👉 Si vous avez reçu une demande de notre part pour valider que vous avez avancé les soins, merci de valider cela directement sur la page du soin correspondant dans l'application. Si vous n'avez reçu aucune demande de notre part, on est bons ! 👌", RIB: ' On dirait que ce document n’a pas de rapport avec un remboursement de santé.\n\n 👉 S’il s’agit de mettre à jour votre RIB, vous pouvez le faire directement depuis votre compte:\n - Cliquez sur votre nom tout en haut à droite de l’écran puis sur Mon compte\n - Cliquez sur Coordonnées bancaires au centre de l’écran\n - Cliquez ensuite sur Modifier pour modifier votre RIB.', PEC_request: " Ce document est une demande de prise en charge qui doit être transmise à notre partenaire de tiers-payant.\n\n 👉 Merci d'indiquer à votre professionnel de santé de s’adresser directement à Almerys.", generic_not_usable: f'🤭 On dirait que ce document n’a pas de rapport avec un remboursement de santé.
👉 Si c’est une erreur, vous pouvez nous renvoyer le bon document. On s’en occupera rapidement !
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', attestation_perimee: f'👉 Nous vous invitons à nous renvoyer une attestation en cours de validité (datée de moins de 3 mois).
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', ss_attestation_incomplete: f'🤭 Le document ne contient pas toutes les informations pour que nous puissions le traiter. Il nous manque des informations concernant le parent de référence.
👉 Nous vous invitons à nous renvoyer une version mentionnant le parent de référence ainsi que les bénéficiaires qui lui sont rattachés.
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}'}}
SUB_REJECTION_LABEL
module-attribute
¶
SUB_REJECTION_LABEL = {
beneficiary_name_missing: "Le nom du bénéficiaire n'est pas spécifié",
beneficiary_name_not_in_policy: "Le nom du bénéficiaire n'est pas couvert par le contrat",
beneficiary_name_not_matching: "Le nom du bénéficiaire ne correspond pas à celui enregistré sur le contrat",
health_professional_name_missing: "Le nom du professionnel de santé n'est pas spécifié",
health_professional_name_exact_name_unknown: "Le nom exact du professionnel de santé n'est pas spécifié",
health_professional_adeli_missing: "Le Nº ADELI/RPPS n'est pas spécifié",
health_professional_adeli_not_readable: "Le Nº ADELI/RPPS n'est pas complet/lisible",
health_professional_signature_missing: "La signature n'est pas présente",
health_professional_signature_stamp_missing: "Le tampon n'est pas présent",
care_type_unknown: "Le type de soin n'est pas spécifié",
care_act_price_not_separated: "Le prix de chaque soin n'est pas indiqué séparément",
care_act_missing: "Le code de regroupement pour chacun des actes mentionnés n'est pas spécifié",
care_act_optic_equipment_missing: "Le code de regroupement pour chacun des éléments de l’équipement optique n’est pas spécifié",
care_act_expired_code: "Certains codes de regroupements ou codes actes apparaissant dans le document sont périmés et ne doivent plus être utilisés",
care_act_not_specified: "Le détail des actes envisagés n'est pas spécifié",
care_act_eyes_missing: "Oeil(s) non spécifié(s)",
quote_date_missing: "La date n'est pas spécifiée",
quote_date_invalid: "La date n'est pas valide",
quote_date_expired: "Le devis a expiré",
brss_missing: "La BRSS de chaque soin n'est pas spécifiée",
brss_not_separated: "La BRSS de chaque soin n'est pas indiquée séparément",
exceeding_fees_not_separated: "Les dépassements d'honoraires de chaque soin ne sont pas indiqués séparément",
surco_quote_missing: "Le devis initial avec les bases des actes envisagés est manquant",
}
rejection ¶
CATEGORY_REJECTION_REASONS
module-attribute
¶
CATEGORY_REJECTION_REASONS = {
prescription: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
non_EU_prescription,
],
mutuelle_decompte: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
other_insurer_decompte_100,
],
ss_decompte: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
cares_received_abroad,
insufficent_info_for_parsing,
secu_decompte_100,
],
invoice: [
unreadable,
unusable_partial_document,
duplicate,
ask_paid_invoice,
beneficiary_not_covered,
cares_received_abroad,
insufficent_info_for_parsing,
missing_mt_or_dmt,
etiopathe,
kine_invoice_without_mezieres,
hospital_receipt,
laboratory_invoice,
titre_de_recette,
acupuncture,
alternative_medicine_quantity_limit_reached,
quittance_100,
hospi_addressed_alan,
],
mutuelle_no_coverage_attestation: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
],
birth_or_adoption_certificate: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
],
quote: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
cares_received_abroad,
insufficent_info_for_parsing,
missing_mt_or_dmt,
etiopathe,
acupuncture,
estimation_already_sent,
],
unsupported: [
unreadable,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
almerys_PEC_rejected,
almerys_PEC_request,
arret_de_travail,
feuille_de_soins,
french_state_payment_attestation,
hospi_PEC_request,
indemnite_journalieres,
payment_card_ticket,
RIB,
PEC_request,
generic_not_usable,
laboratory_invoice,
],
non_claims_prescription: DEFAULT_REJECTION_REASONS,
medical_certificate: DEFAULT_REJECTION_REASONS,
medical_imaging: DEFAULT_REJECTION_REASONS,
medical_results: DEFAULT_REJECTION_REASONS,
cancel_teletransmission_request: DEFAULT_REJECTION_REASONS,
other_health: [
unreadable,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
almerys_PEC_rejected,
almerys_PEC_request,
arret_de_travail,
feuille_de_soins,
french_state_payment_attestation,
hospi_PEC_request,
indemnite_journalieres,
payment_card_ticket,
RIB,
PEC_request,
generic_not_usable,
],
ss_attestation: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
attestation_perimee,
ss_attestation_incomplete,
],
}
DEFAULT_REJECTION_REASONS
module-attribute
¶
DEFAULT_REJECTION_REASONS = [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
non_EU_prescription,
]
get_rejection_reasons_per_category ¶
Get the list of rejection reason for a document category with the default message we want to send to the user return: list[RejectionReason]
Source code in components/fr/public/document_parsing/queries/rejection.py
get_sub_rejection_reasons_per_category ¶
Get the list of sub rejection reason for a document category For now we only return for quote return: dict[str, list[RejectionReason]] | None
Source code in components/fr/public/document_parsing/queries/rejection.py
components.fr.public.dsn ¶
company ¶
Set of functions to query information about companies present in the DSN.
The DSN data model is composed of DSN "companies" and "establishments". A "company" in the context of the module does NOT refer specifically to a DSN "company" but to any entity (usually an "establishment").
get_companies_from_sirens ¶
Fetch companies for the given SIRENs.
Source code in components/fr/public/dsn/company.py
get_company_from_siret ¶
Fetch the company based on its SIRET.
Source code in components/fr/public/dsn/company.py
contract_download ¶
get_contracts_download_zip_for_companies ¶
This function is used to download the contracts (both PDF and XML, in ZIP) for a given companies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
company_ids
|
list[int] | set[int]
|
List of company IDs to download contracts for |
required |
Returns:
| Type | Description |
|---|---|
tuple[dict[str, str] | None, bool]
|
tuple[dict[str, str] | None, bool]: Zip attachment and boolean indicating if any FDP was found |
Source code in components/fr/public/dsn/contract_download.py
components.fr.public.employees ¶
employees ¶
get_employees_for_admin_dashboard ¶
get_employees_for_admin_dashboard(
company_ids,
scope_ids,
cursor,
limit,
search,
employee_types,
employment_types,
coverage_statuses,
professional_categories,
ccn_ids,
status_details,
coverage_status_details=None,
mandatory_coverages=None,
)
Get employees for the admin dashboard. It won't make any admin rights checks, please make sure the user has the rights to see the given companies & scopes. :param company_ids: The companies to fetch the employees from, it will fetch all employees from the companies, except if scopes for those companies are also given :param scope_ids: The scopes to fetch the employees from, if some scopes belong to given companies ids, only employees from those scopes will be fetched :param cursor: The cursor to handle pagination :param limit: The limit of employees to fetch :param search: The search string to filter employees :param employee_types: The employee types to filter :param employment_types: The employment types to filter :param coverage_statuses: The coverage statuses to filter :param professional_categories: The professional categories to filter :param ccn_ids: The CCN ids to filter :param mandatory_coverages: The mandatory coverages to filter (true = mandatory, false = optional) :return: The paginated employees, filtered by given filters
Source code in components/fr/public/employees/employees.py
terminated_employees ¶
get_terminated_employee_details ¶
get_terminated_employees ¶
get_terminated_employees(
company_ids,
operational_scope_ids,
cursor,
limit,
search,
terminated_employee_types,
)
Source code in components/fr/public/employees/terminated_employees.py
get_terminated_employees_counts ¶
Source code in components/fr/public/employees/terminated_employees.py
components.fr.public.employment ¶
admin_resolvers ¶
dsn_removal_suggestion_resolver ¶
DsnRemovalSuggestionResolver ¶
Bases: AdminErrorResolver
Resolver for DSN removal suggestion blocked movements.
Admins can either confirm the removal or cancel it.
apply_resolution ¶
Apply the admin's resolution choice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocked_movement
|
CoreBlockedMovement | UpstreamBlockedMovement
|
The blocked movement to resolve |
required |
action
|
AdminResolutionAction
|
cancel (ignore suggestion) or apply (remove the employee) |
required |
params
|
dict[str, Any] | None
|
Not used — no overrides needed for DSN removal suggestions. |
None
|
Source code in components/fr/public/employment/admin_resolvers/dsn_removal_suggestion_resolver.py
can_resolve ¶
Only core blocked movements from DSN removal suggestions with a termination rule case.
Source code in components/fr/public/employment/admin_resolvers/dsn_removal_suggestion_resolver.py
get_resolution_context ¶
Extract data needed for admin resolution modal.
Returns employee info, event date, and termination reason — same data as displayed on the fixAdminInputRequired page.
Source code in components/fr/public/employment/admin_resolvers/dsn_removal_suggestion_resolver.py
is_termination ¶
Check that the action_not_allowed is indeed a termination.
Source code in components/fr/public/employment/admin_resolvers/dsn_removal_suggestion_resolver.py
missing_ssn_ntt_resolver ¶
MissingSsnNttResolutionParams ¶
Bases: TypedDict
Parameters for resolving a missing SSN/NTT blocked movement.
All fields are optional for cancel action. For apply action, both inputType and inputValue are required.
Expected keys
- inputType: Literal["ssn", "ntt"] - Type of identifier to add
- inputValue: str - The SSN or NTT value
MissingSsnNttResolver ¶
Bases: AdminErrorResolver
Resolver for missing required SSN or NTT blocked movements.
Missing required SSN or NTT occur when an employee declaration has no SSN or NTT. Admins can resolve these by: - Canceling the declaration - Applying with either an SSN or NTT override (mutually exclusive)
apply_resolution ¶
Apply the admin's resolution choice to the missing required SSN or NTT blocked movement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocked_movement
|
CoreBlockedMovement | UpstreamBlockedMovement
|
The blocked movement to resolve |
required |
action
|
AdminResolutionAction
|
The action chosen by the admin (cancel or apply) |
required |
params
|
dict[str, Any] | None
|
Optional parameters containing: - inputType: "ssn" or "ntt" - inputValue: the validated SSN or NTT string |
None
|
Raises:
| Type | Description |
|---|---|
ResolutionActionError
|
If the action is invalid or the resolution cannot be applied |
Source code in components/fr/public/employment/admin_resolvers/missing_ssn_ntt_resolver.py
can_resolve ¶
Check if this resolver can handle the given blocked movement.
Only upstream blocked movements can be resolved.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocked_movement
|
CoreBlockedMovement | UpstreamBlockedMovement
|
The blocked movement to check |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if this is an upstream blocked movement, False otherwise |
Source code in components/fr/public/employment/admin_resolvers/missing_ssn_ntt_resolver.py
get_resolution_context ¶
Return resolution data for a missing SSN/NTT blocked movement.
Extracts employee information and defines display fields for the admin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocked_movement
|
CoreBlockedMovement | UpstreamBlockedMovement
|
The blocked movement to get context for |
required |
Returns:
| Type | Description |
|---|---|
AdminResolutionContext
|
AdminResolutionContext with employee and company information |
Raises:
| Type | Description |
|---|---|
ResolutionActionError
|
If blocked movement is missing required data |
Source code in components/fr/public/employment/admin_resolvers/missing_ssn_ntt_resolver.py
no_eligible_contract_found_resolver ¶
AvailableContractInfo ¶
NoEligibleContractFoundResolver ¶
Bases: AdminErrorResolver
Resolver for no_eligible_contract_found blocked movements.
This error occurs when attempting to affiliate an employee to a contract that doesn't exist or doesn't match the employee's data (date, category, CCN).
apply_resolution ¶
Apply the admin's resolution choice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocked_movement
|
CoreBlockedMovement | UpstreamBlockedMovement
|
The blocked movement to resolve |
required |
action
|
AdminResolutionAction
|
cancel or apply |
required |
params
|
dict[str, Any] | None
|
Optional overrides for date, category, or CCN. Expected keys: - start_date_override: ISO date string for new start date - professional_category_override: Professional category string - ccn_code_override: CCN code string |
None
|
Source code in components/fr/public/employment/admin_resolvers/no_eligible_contract_found_resolver.py
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 313 314 315 316 317 318 319 320 321 322 323 | |
can_resolve ¶
Only core blocked movements can be resolved.
Source code in components/fr/public/employment/admin_resolvers/no_eligible_contract_found_resolver.py
get_resolution_context ¶
Extract and format data needed for admin resolution.
Returns:
| Type | Description |
|---|---|
AdminResolutionContext
|
|
AdminResolutionContext
|
|
AdminResolutionContext
|
|
Source code in components/fr/public/employment/admin_resolvers/no_eligible_contract_found_resolver.py
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 | |
ResolutionContextData ¶
Bases: TypedDict
Data provided to admin for resolution decision.
fr_country_gateway ¶
FrCountryGateway ¶
Bases: CountryGateway[FrExtendedValues]
Implementation of the Employment Component's CountryGateway for France.
are_companies_in_same_account ¶
Source code in components/fr/public/employment/fr_country_gateway.py
extract_external_employee_id_from_data ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_account_name ¶
get_admin_error_resolver_classes ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_blocked_invitations_validation_broadcast_id ¶
get_company_information ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_consumers_to_notify_for_legacy_backfill ¶
Returns the consumers to notify for the legacy backfill source type.
Source code in components/fr/public/employment/fr_country_gateway.py
get_employee_email_from_extended_values ¶
Retrieves the employee email from FR extended values.
Source code in components/fr/public/employment/fr_country_gateway.py
get_employee_identifier_for_country ¶
get_employment_consumers ¶
Gets all employment consumers contributed by this country.
Notes: 1. ALL Employment Consumers will be called regardless of the country of origin. 2. The function that will be called must have all local code as LOCAL imports - otherwise, this breaks Canada (where loading non-CA models is forbidden)
Source code in components/fr/public/employment/fr_country_gateway.py
get_local_under_investigation_error_codes ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_retry_function ¶
(Advanced) Get the function used for retrying Core Blocked Movements.
You should generally not need to implement this.
Source code in components/fr/public/employment/fr_country_gateway.py
get_source_detail_for_blocked_movement ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_subscriptions_for_company ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_upstream_retry_handler ¶
get_user_admined_company_ids ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_user_email ¶
get_user_full_name ¶
last_stale_invite_notification_email_sent_to_admin_on ¶
Source code in components/fr/public/employment/fr_country_gateway.py
fr_extended_values ¶
EmployeeTerminationType ¶
Bases: AlanBaseEnum
ani_member_declared_new_job
class-attribute
instance-attribute
¶
departure_end_apprentice
class-attribute
instance-attribute
¶
departure_negociated_termination
class-attribute
instance-attribute
¶
departure_resignation
class-attribute
instance-attribute
¶
departure_resignation_with_ani
class-attribute
instance-attribute
¶
departure_termination
class-attribute
instance-attribute
¶
departure_termination_fault
class-attribute
instance-attribute
¶
invited_in_retirement
class-attribute
instance-attribute
¶
retirement_with_ani
class-attribute
instance-attribute
¶
ExemptionType ¶
Bases: AlanBaseEnum
already_covered_indiv
class-attribute
instance-attribute
¶
already_covered_military
class-attribute
instance-attribute
¶
already_covered_other_employer
class-attribute
instance-attribute
¶
already_covered_partner
class-attribute
instance-attribute
¶
already_covered_regime_local
class-attribute
instance-attribute
¶
already_covered_state_agent
class-attribute
instance-attribute
¶
cdd_already_covered
class-attribute
instance-attribute
¶
cdd_less_than_a_year
class-attribute
instance-attribute
¶
cdd_less_than_three_months
class-attribute
instance-attribute
¶
continue_to_refuse_coverage
class-attribute
instance-attribute
¶
health_payment_beneficiary
class-attribute
instance-attribute
¶
FrEmploymentDeclaration
module-attribute
¶
FrExtendedValues ¶
Bases: ExtendedValuesDict
Local values for France employments in the Employment Component
ProfessionalCategory ¶
Bases: AlanBaseEnum
This enum is used to model both the professional category of persons and abstract objects, such as contracts: - persons can be "cadres", "non_cadres", or NULL which models we don't know their professional category; - abstract entities can be "cadres", "non_cadres", or NULL which models we don't have to apply any constraint on the object regarding the professional category. Either way, we want to get rid of the "all" value. It was more targeted at the second use case but it's more coherent to model objects the same way for both kind of objects.
queries ¶
get_user_active_employment_in_company_on_or_after ¶
Source code in components/fr/internal/business_logic/company/queries/employment.py
components.fr.public.enrollment ¶
components.fr.public.entities ¶
components.fr.public.enums ¶
components.fr.public.events ¶
subscription ¶
subscribe_to_events ¶
All event subscriptions for France should be done here.
Source code in components/fr/public/events/subscription.py
components.fr.public.feature ¶
is_feature_active ¶
Check if a feature is active :param feature_name: the name of the feature :return: true if the feature with this name is found and active
Source code in components/fr/public/feature.py
components.fr.public.fraud_detection ¶
actions ¶
fraud_relevant_user_change ¶
FraudRelevantUserChangeSource ¶
track_changed_email_for_fraud ¶
track_changed_email_for_fraud(
actor_id,
user_id,
new_email,
old_email,
source=None,
commit=False,
)
Source code in components/fr/internal/fraud_detection/business_logic/actions/fraud_relevant_user_change.py
enums ¶
queries ¶
find_most_recent_fraud_relevant_user_changes ¶
find_most_recent_fraud_relevant_user_changes(
user_ids,
change_type=None,
limit=None,
since=None,
until=None,
)
Source code in components/fr/internal/fraud_detection/business_logic/queries/fraud_relevant_user_change.py
has_open_fraud_investigation ¶
Source code in components/fr/internal/fraud_detection/business_logic/queries/has_open_fraud_investigation.py
components.fr.public.global_customer_dashboard ¶
admin ¶
get_admined_entities_for_entity_selector_fr ¶
Source code in components/fr/public/global_customer_dashboard/admin.py
get_pending_onboardings_for_admined_entity_selector_fr ¶
Source code in components/fr/public/global_customer_dashboard/admin.py
product_setting ¶
get_account_settings_for_company ¶
Returns the list of activated AccountSetting for the given company :param company_id: The ID of the company we want AccountSetting for :return: The list of activated AccountSetting for this company
Source code in components/fr/public/global_customer_dashboard/product_setting.py
components.fr.public.health_pricing ¶
components.fr.public.intercom ¶
actions ¶
intercom_user_id ¶
get_or_create_intercom_user_id ¶
Get or create an Intercom user ID for the given user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
is_admin
|
bool
|
Whether to use the pro email (admin) or personal email. |
required |
user_id
|
int
|
The user ID to get or create the Intercom user for. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The Intercom user ID, or None if creation failed. |
Source code in components/fr/public/intercom/actions/intercom_user_id.py
components.fr.public.kyc ¶
actions ¶
install_reimbursement_blocker_for_siren ¶
Source code in components/fr/internal/kyc/business_logic/actions/reimbursement_blocker.py
enums ¶
helpers ¶
is_siren_already_cleared ¶
Check if the last KYC Check on the SIREN was an approbation Return False in all other cases
Source code in components/fr/internal/kyc/business_logic/helpers/kyc_checks.py
components.fr.public.member_attributes ¶
getter_decorators ¶
Decorators that resolve a global Profile into FR-specific models for member attribute getters.
Each decorator pops profile from kwargs, resolves it to the corresponding
FR model, injects the result under a model-specific kwarg name, and forwards
the remaining kwargs to the wrapped getter.
uses_fr_contract ¶
Profile -> FR Contract. Injects contract=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_enrollment ¶
Pass-through for FR Enrollment. Injects enrollment=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_insurance_profile ¶
Profile -> FR InsuranceProfile. Injects insurance_profile=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_option_settings ¶
Profile -> FR PolicyOptionSettings. Injects option_settings=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_policy ¶
Profile -> FR current Policy. Injects policy=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_primary_user ¶
Profile -> FR primary User. Injects user=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_user ¶
Profile -> FR User. Injects user=.
Source code in components/fr/public/member_attributes/getter_decorators.py
resolvers ¶
Resolve a global Profile into FR-specific models.
These are internal implementation details of the getter decorators and should not be imported directly by other components.
resolve_contract ¶
Profile -> FR Contract (via current policy).
resolve_current_policy ¶
resolve_insurance_profile ¶
Profile -> FR InsuranceProfile.
resolve_option_settings ¶
Profile -> FR PolicyOptionSettings (via current policy).
Source code in components/fr/public/member_attributes/resolvers.py
resolve_primary_user ¶
Profile -> FR primary User (via policy.primary_profile).
Source code in components/fr/public/member_attributes/resolvers.py
resolve_user ¶
Profile -> FR User.
Source code in components/fr/public/member_attributes/resolvers.py
components.fr.public.member_lifecycle ¶
ani ¶
member_attributes ¶
ani_employment_duration_justification_requirement
module-attribute
¶
ani_employment_duration_justification_requirement = MemberAttributeDefinition[
AniEmploymentDurationJustificationRequirement
](
name="ani_employment_duration_justification_requirement",
display_name="ANI employment duration justification requirement",
description="ANI employment duration justification requirement status",
getter=_get_ani_employment_duration_justification_requirement,
raw_type=AniEmploymentDurationJustificationRequirement,
formatter=_format_ani_employment_duration_justification_requirement,
)
ani_entry_date
module-attribute
¶
ani_entry_date = MemberAttributeDefinition[date](
name="ani_entry_date",
display_name="ANI entry date",
description="ANI portability entry date",
getter=_get_ani_entry_date,
raw_type=date,
)
ani_justification_rejection_reason
module-attribute
¶
ani_justification_rejection_reason = MemberAttributeDefinition[
JustificationRejectionStatus
](
name="ani_justification_rejection_reason",
display_name="ANI justification rejection reason",
description="Rejection reason from latest ANI justification",
getter=_get_ani_justification_rejection_reason,
raw_type=JustificationRejectionStatus,
formatter=_format_ani_justification_rejection_reason,
)
ani_justification_requirement
module-attribute
¶
ani_justification_requirement = MemberAttributeDefinition[
AniJustificationRequirement
](
name="ani_justification_requirement",
display_name="ANI justification requirement",
description="Current ANI justification requirement status",
getter=_get_ani_justification_requirement,
raw_type=AniJustificationRequirement,
formatter=_format_ani_justification_requirement,
)
ani_justification_status_history
module-attribute
¶
ani_justification_status_history = MemberAttributeDefinition(
name="ani_justification_status_history",
display_name="ANI justification status history",
description="History of ANI justification statuses by month",
getter=_get_ani_justification_status_history,
raw_type=dict,
formatter=_format_ani_justification_status_history,
)
ani_payslip_status_history
module-attribute
¶
ani_payslip_status_history = MemberAttributeDefinition(
name="ani_payslip_status_history",
display_name="ANI payslip status history",
description="History of ANI payslip statuses",
getter=_get_ani_payslip_status_history,
raw_type=list,
formatter=_format_ani_payslip_status_history,
)
max_ani_end_date
module-attribute
¶
max_ani_end_date = MemberAttributeDefinition[date](
name="max_ani_end_date",
display_name="Max ANI end date",
description="Maximum ANI portability end date",
getter=_get_max_ani_end_date,
raw_type=date,
)
exemption ¶
member_attributes ¶
exemption_justification_rejection_reason
module-attribute
¶
exemption_justification_rejection_reason = MemberAttributeDefinition[
ExemptionJustificationRejectionReason
](
name="exemption_justification_rejection_reason",
display_name="Exemption justification rejection reason",
description="Justification rejection reason of the user's current exemption",
getter=_get_exemption_justification_rejection_reason,
raw_type=ExemptionJustificationRejectionReason,
formatter=_format_exemption_justification_rejection_reason,
)
exemption_justification_status
module-attribute
¶
exemption_justification_status = MemberAttributeDefinition[
JustificationStatus
](
name="exemption_justification_status",
display_name="Exemption justification status",
description="Justification status of the user's current exemption",
getter=_get_exemption_justification_status,
raw_type=JustificationStatus,
)
exemption_status
module-attribute
¶
exemption_status = MemberAttributeDefinition[
ExemptionOnboardingStatus
](
name="exemption_status",
display_name="Exemption status",
description="Onboarding status of the user's current exemption",
getter=_get_exemption_status,
raw_type=ExemptionOnboardingStatus,
)
recent_exemptions
module-attribute
¶
recent_exemptions = MemberAttributeDefinition[
list[ExemptionMemberAttribute]
](
name="recent_exemptions",
display_name="Recent exemptions",
description="Recent non-cancelled exemptions for the user",
getter=_get_recent_exemptions,
raw_type=list,
formatter=_format_recent_exemptions,
)
components.fr.public.operational_scopes ¶
employment_consumer ¶
operational_scopes_employment_change_consumer ¶
Source code in components/fr/public/operational_scopes/employment_consumer.py
components.fr.public.policy ¶
member_attributes ¶
PolicyStatus ¶
Bases: AlanBaseEnum
Policy lifecycle status for member attribute.
all_birth_or_adoption_certificates_def
module-attribute
¶
all_birth_or_adoption_certificates_def = MemberAttributeDefinition[
list[BirthOrAdoptionCertificateInfo]
](
name="all_birth_or_adoption_certificates",
display_name="All birth or adoption certificates",
description="List of birth or adoption certificates for the policy",
getter=_get_all_birth_or_adoption_certificates,
raw_type=list[BirthOrAdoptionCertificateInfo],
formatter=_format_birth_and_adoption_certificates,
)
date_block_reimbursements
module-attribute
¶
date_block_reimbursements = MemberAttributeDefinition[date](
name="date_block_reimbursements",
display_name="Date block reimbursements",
description="Date from which reimbursements are blocked",
getter=_get_date_block_reimbursements,
raw_type=date,
)
employee_costs
module-attribute
¶
employee_costs = MemberAttributeDefinition[
BeneficiaryPrice
](
name="employee_costs",
display_name="Employee costs",
description="Employee pricing breakdown by beneficiary type",
getter=_get_employee_costs,
raw_type=BeneficiaryPrice,
formatter=_format_employee_costs,
)
employee_costs_option
module-attribute
¶
employee_costs_option = MemberAttributeDefinition[
list[BeneficiaryPrice]
](
name="employee_costs_option",
display_name="Employee costs option",
description="Option pricing breakdown by beneficiary type",
getter=_get_employee_costs_option,
raw_type=list[BeneficiaryPrice],
formatter=_format_employee_costs_option,
)
most_recent_quote_document
module-attribute
¶
most_recent_quote_document = MemberAttributeDefinition[
QuoteDocumentInfo
](
name="most_recent_quote_document",
display_name="Most recent quote document",
description="Most recent quote document for the policy",
getter=_get_most_recent_quote_document,
raw_type=QuoteDocumentInfo,
)
policy_id
module-attribute
¶
policy_id = MemberAttributeDefinition[int](
name="policy_id",
display_name="Policy ID",
description="Current policy ID",
getter=_get_policy_id,
raw_type=int,
)
policy_status
module-attribute
¶
policy_status = MemberAttributeDefinition[PolicyStatus](
name="policy_status",
display_name="Policy status",
description="Current policy lifecycle status (active, ended, ANI, etc.)",
getter=_get_policy_status,
raw_type=PolicyStatus,
formatter=_format_policy_status,
)
policy_termination_type
module-attribute
¶
policy_termination_type = MemberAttributeDefinition[
EmployeeTerminationType
](
name="policy_termination_type",
display_name="Policy termination type",
description="Type of policy termination",
getter=_get_policy_termination_type,
raw_type=EmployeeTerminationType,
formatter=_format_policy_termination_type,
)
recent_quote_documents
module-attribute
¶
recent_quote_documents = MemberAttributeDefinition[
list[QuoteDocumentInfo]
](
name="recent_quote_documents",
display_name="Recent quote documents",
description="Recent quote documents for the policy",
getter=_get_recent_quote_documents,
raw_type=list[QuoteDocumentInfo],
)
reimbursement_block_reason
module-attribute
¶
reimbursement_block_reason = MemberAttributeDefinition[
BlockReimbursementsReason
](
name="reimbursement_block_reason",
display_name="Reimbursement block reason",
description="Reason reimbursements are blocked",
getter=_get_reimbursement_block_reason,
raw_type=BlockReimbursementsReason,
formatter=_format_reimbursement_block_reason,
)
policy ¶
get_n_base_filtered_children_on ¶
Source code in components/fr/public/policy/policy.py
get_n_base_paid_filtered_children_on ¶
Source code in components/fr/public/policy/policy.py
is_policy_change_significant ¶
is_policy_change_significant(
old_policy_id,
new_policy_id,
new_start_date,
old_policy_precomputed_coverage=None,
)
Returns True if the change between two policies is significant, and member notification and action is required.
Returns False if the change can be considered "transparent" and does not require member action.
This function should be used primarily for employee transfer cases.
Source code in components/fr/public/policy/policy.py
is_policy_coverage_different ¶
is_policy_coverage_different(
old_policy_id,
new_policy_id,
last_day_date,
new_start_date,
old_policy_precomputed_coverage=None,
)
Returns True if the coverage differs between the two policies (either in pricing or in actual coverage).
Source code in components/fr/public/policy/policy.py
precompute_policy_coverage_for_policy_comparison ¶
For use with is_policy_change_significant in case you need to cancel the policy afterwards (otherwise, after cancellation, the cost becomes 0)
Source code in components/fr/public/policy/policy.py
components.fr.public.prevoyance ¶
entities ¶
PrevoyanceGuaranteeSpecBeneficiaryEligibilityCriteria
dataclass
¶
PrevoyanceGuaranteeSpecBeneficiaryEligibilityCriteria(
beneficiary_relationship_type,
max_age_at_disability_start_date=None,
min_covered_age=None,
max_covered_age=None,
disabled_max_covered_age=None,
student_max_covered_age=None,
unemployed_without_benefits_max_covered_age=None,
apprentice_max_covered_age=None,
is_dependent=None,
is_under_supervision_or_in_psychiatric_hospital=None,
paid_for_the_funeral=None,
)
Bases: DataClassJsonMixin
This dataclass describes the beneficiary criteria to be eligible to a prevoyance guarantee spec.
Only specific beneficiary could benefit from the coverage of certain guarantees (eg rente education only for children at charge, member in case of work stoppage)
PrevoyanceGuaranteeSpecEligibilityCriteria
dataclass
¶
Bases: DataClassJsonMixin
These criteria determine in which circumstances guarantees are eligible and could be covered.
When in such circumstances, we would only create / suggest claims with the eligible guarantees (eg for a death: death lump sum, rente education, funerals, etc).
Criteria are of different nature: - Event: guarantees only apply to specific events, in specific situation (eg. accidental death) - Member: guarantees eligibility could depend on the member tenure, on the member dependents, on their disability condition etc - Beneficiary: some guarantees only apply to specific beneficiaries (eg rente education only for children at charge)
Exploration can be found here https://docs.google.com/spreadsheets/d/1yyLaVasQnwSVhASZ3c41d7hFkp56RxiRmSwlMBHj2Mg/edit?usp=sharing ⧉ https://docs.google.com/document/d/1qIsYQgD6Iy9dLN61iKAbAD0S-LLHRCcmvE_owSyvFbk/edit?usp=sharing ⧉
PrevoyanceGuaranteeSpecEventEligibilityCriteria
dataclass
¶
PrevoyanceGuaranteeSpecEventEligibilityCriteria(
event_type,
event_user_relationship_type,
death_event_user_min_age=None,
death_event_user_max_age=None,
event_is_not_covered_by_secu=None,
event_is_covered_in_parental_leave=None,
event_is_accidental=None,
event_is_accidental_or_after_professional_disease=None,
event_required_assistance_from_third_party=None,
event_has_led_to_hospitalisation=None,
event_is_long_term_condition=None,
work_stoppage_valid_reasons=None,
work_stoppage_min_duration_days=None,
death_is_before_member_death=None,
death_is_simultaneous_partner_death=None,
simultaneous_partner_death_max_delay_months=None,
disability_is_atmp=None,
disability_rate_min=None,
disability_rate_max=None,
disability_categories=None,
)
Bases: DataClassJsonMixin
This dataclass describes the prevoyance event criteria to be eligible to a prevoyance guarantee spec
Guarantee would only cover specific events based on these criteria (eg. type of event, if death is accidental or on the disability rate)
death_is_before_member_death
class-attribute
instance-attribute
¶
death_is_simultaneous_partner_death
class-attribute
instance-attribute
¶
event_has_led_to_hospitalisation
class-attribute
instance-attribute
¶
event_is_accidental_or_after_professional_disease
class-attribute
instance-attribute
¶
event_is_covered_in_parental_leave
class-attribute
instance-attribute
¶
event_is_long_term_condition
class-attribute
instance-attribute
¶
event_is_not_covered_by_secu
class-attribute
instance-attribute
¶
event_required_assistance_from_third_party
class-attribute
instance-attribute
¶
simultaneous_partner_death_max_delay_months
class-attribute
instance-attribute
¶
work_stoppage_min_duration_days
class-attribute
instance-attribute
¶
PrevoyanceGuaranteeSpecMemberEligibilityCriteria
dataclass
¶
PrevoyanceGuaranteeSpecMemberEligibilityCriteria(
min_tenure_months=None,
max_tenure_months=None,
max_tenure_or_less_than_200_hours_per_trimester=None,
min_hours_worked_in_trimester=None,
max_hours_worked_in_trimester=None,
min_covered_presence_days=None,
has_dependent_children=None,
has_dependent=None,
is_married_or_pacsed=None,
)
Bases: DataClassJsonMixin
This dataclass describes the member criteria to be eligible to a prevoyance guarantee spec
It could be based on the member tenure in the company at the event date or on their dependents at charge
queries ¶
PrevoyanceCCNContstraintEntity
dataclass
¶
Bases: DataClassJsonMixin
Represents a constraint for a prevoyance contract CCN.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
The unique identifier of the constraint. |
ccn_id |
int
|
The ID of the CCN. |
non_cadre_coverage_required |
bool
|
Indicates if non-cadre coverage for all contracts on the ccn. |
PrevoyanceParticipationCCNContstraintEntity
dataclass
¶
PrevoyanceParticipationCCNContstraintEntity(
id, ccn_id, professional_category, minimum_participation
)
Bases: DataClassJsonMixin
Represents a participation constraint for a prevoyance contract CCN.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
The unique identifier of the constraint. |
ccn_id |
int
|
The ID of the CCN. |
professional_category |
Optional[ProfessionalCategory]
|
The professional category. |
minimum_participation |
float
|
The minimum participation required for the professional category on the ccn. |
get_prevoyance_ccn_constraints ¶
Return the list of PrevoyanceCCNCoinstraints for a list of ccn_ids.
Source code in components/fr/public/prevoyance/queries.py
get_prevoyance_participation_ccn_constraints ¶
Return the list of CCN constraints that apply to the company's prevoyance contract.
Source code in components/fr/public/prevoyance/queries.py
get_work_stoppages_for_users ¶
Get the list of work stoppages for a list of users.
Source code in components/fr/public/prevoyance/queries.py
components.fr.public.queries ¶
command_logs ¶
get_command_logs ¶
Source code in components/fr/public/queries/command_logs.py
policy_direct_billing_contract ¶
get_policy_direct_billing_contract_on ¶
Source code in components/fr/internal/business_logic/policy_direct_billing_contract/queries/policy_direct_billing_contract.py
unpaid_leave ¶
get_unpaid_leave_settings_from_policy ¶
Source code in components/fr/internal/business_logic/unpaid_leave/queries/unpaid_leave_settings.py
get_unpaid_leave_settings_from_user_health_contract ¶
Source code in components/fr/internal/business_logic/unpaid_leave/queries/unpaid_leave_settings.py
components.fr.public.scim_api ¶
adapter ¶
FrScimAdapter ¶
Bases: GenericScimAdapter
SCIM adapter for fr_api.
Source code in components/fr/public/scim_api/adapter.py
create_app_user ¶
Create a user with the given first and last name. and returns the user ID.
Source code in components/fr/public/scim_api/adapter.py
get_scim_users_data ¶
Returns the first and last name of users from a list of AlanEmployee objects.
Source code in components/fr/public/scim_api/adapter.py
get_user_data ¶
Returns user's first and last name by user_id.
Source code in components/fr/public/scim_api/adapter.py
test ¶
test_adapter ¶
adapter ¶
profile_service ¶
test_create_app_user ¶
Test create_app_user creates a new user correctly.
Source code in components/fr/public/scim_api/test/test_adapter.py
test_get_scim_users_data ¶
Test get_scim_users_data returns correct mapping of user data.
Source code in components/fr/public/scim_api/test/test_adapter.py
test_get_user_data ¶
Test get_user_data returns correct user identity.
Source code in components/fr/public/scim_api/test/test_adapter.py
components.fr.public.services ¶
push_notifications ¶
get_push_notification_logs_for_user ¶
get_push_notification_logs_for_user(
app_name,
app_user_id,
notification_names,
created_at__gte=None,
)
Return a list of all the push notification logs ever created for the given user and notification names.
Source code in components/fr/public/services/push_notifications.py
push_notification_sender_async ¶
Source code in components/fr/internal/push_notifications/push_notification_sender.py
push_notification_sender_sync ¶
Source code in components/fr/internal/push_notifications/push_notification_sender.py
components.fr.public.test_data_generator ¶
get_test_data_generation_config ¶
Source code in components/fr/internal/admin_tools/fixtures/test_data_generation_config.py
components.fr.public.tp_card ¶
member_attributes ¶
Member attribute definitions for FR TP card attributes.
can_request_physical_tp_card
module-attribute
¶
can_request_physical_tp_card = MemberAttributeDefinition[
bool
](
name="can_request_physical_tp_card",
display_name="Can request physical TP card",
description="Whether the member can request a physical TP card",
getter=_get_can_request_physical_tp_card,
raw_type=bool,
)
date_physical_tp_card_shipped
module-attribute
¶
date_physical_tp_card_shipped = MemberAttributeDefinition[
date
](
name="date_physical_tp_card_shipped",
display_name="Date physical TP card shipped",
description="Date the physical TP card was shipped",
getter=_get_date_physical_tp_card_shipped,
raw_type=date,
)
did_opt_out_physical_tp_card
module-attribute
¶
did_opt_out_physical_tp_card = MemberAttributeDefinition[
bool
](
name="did_opt_out_physical_tp_card",
display_name="Did opt out of physical TP card",
description="Whether the member opted out of physical TP card",
getter=_get_did_opt_out_physical_tp_card,
raw_type=bool,
)
tp_card_contract_scheme
module-attribute
¶
tp_card_contract_scheme = MemberAttributeDefinition[
TpCardScheme
](
name="tp_card_contract_scheme",
display_name="TP card contract scheme",
description="Contract-level TP card scheme for current enrollment",
getter=_get_tp_card_contract_scheme,
raw_type=TpCardScheme,
)
tp_card_scheme
module-attribute
¶
tp_card_scheme = MemberAttributeDefinition[TpCardScheme](
name="tp_card_scheme",
display_name="TP card scheme",
description="TP card scheme for current enrollment",
getter=_get_tp_card_scheme,
raw_type=TpCardScheme,
)
tp_card_scheme_reason
module-attribute
¶
tp_card_scheme_reason = MemberAttributeDefinition[
InsuranceProfileTpCardSchemeReason
](
name="tp_card_scheme_reason",
display_name="TP card scheme reason",
description="Reason for the TP card scheme",
getter=_get_tp_card_scheme_reason,
raw_type=InsuranceProfileTpCardSchemeReason,
)
tp_card_status
module-attribute
¶
tp_card_status = MemberAttributeDefinition[TpCardStatus](
name="tp_card_status",
display_name="TP card status",
description="Status of the latest TP card",
getter=_get_tp_card_status,
raw_type=TpCardStatus,
)
tp_rights_activated
module-attribute
¶
tp_rights_activated = MemberAttributeDefinition[bool](
name="tp_rights_activated",
display_name="TP rights activated",
description="Whether TP rights are activated",
getter=_get_tp_rights_activated,
raw_type=bool,
)
tp_rights_referent
module-attribute
¶
tp_rights_referent = MemberAttributeDefinition[str](
name="tp_rights_referent",
display_name="TP rights referent",
description="Full name of the TP rights referent",
getter=_get_tp_rights_referent,
raw_type=str,
)
tp_rights_status
module-attribute
¶
tp_rights_status = MemberAttributeDefinition[
TpRightsStatus
](
name="tp_rights_status",
display_name="TP rights status",
description="TP rights status",
getter=_get_tp_rights_status,
raw_type=TpRightsStatus,
formatter=_format_tp_rights_status,
)
components.fr.public.user ¶
actions ¶
user_iban ¶
change_user_iban ¶
change_user_iban(
actor_id,
user_id,
iban_type,
iban,
comment=None,
allow_same_policy=False,
set_current_requires_sepa_signed=False,
save=True,
rollback_at_end=False,
force_new_iban_creation=False,
)
Change the user's IBAN: - If changing the billing IBAN, change it directly and make it as current only if sepa is signed or is not required - If changing the settlement IBAN and the user is changing his own IBAN, change it directly - Otherwise create a pending SettlementIBANChange which will have to be reviewed by an operator before being applied
Source code in components/fr/internal/business_logic/user/actions/user_iban.py
user_lifecycle ¶
get_employee_onboarding_status ¶
Source code in components/fr/internal/business_logic/user/actions/user_lifecycle.py
create_profile_with_user ¶
create_or_assign_profile_with_authenticatable_user ¶
create_or_assign_profile_with_authenticatable_user(
profile_service,
authentication_service,
email,
prehashed_password,
password=None,
mfa_required=None,
first_name=None,
last_name=None,
birth_date=None,
language=None,
phone_number=None,
gender=None,
empty_user=None,
email_verified=True,
)
Helper to create an authenticatable user (with credentials) and helps manage cross-country identities In this method we create a profile without identity elements, then get (or create) the corresponding user and try to set the credentials of this user. Set credentials handles the cases of conflict with existing identities. Finally, we set the profile email address if all steps before didn't raise
Source code in components/fr/public/user/create_profile_with_user.py
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 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 | |
create_profile_with_user ¶
create_profile_with_user(
*,
profile_service,
email=None,
first_name=None,
last_name=None,
birth_date=None,
language=None,
phone_number=None,
gender=None
)
Create a new user (and profile) with the given parameters.
Source code in components/fr/public/user/create_profile_with_user.py
insurance_profile ¶
get_ssn_and_ntt_for_user ¶
Get the SSN and NTT for an existing user.
Source code in components/fr/public/user/insurance_profile.py
get_ssn_and_ntt_for_users ¶
Get the SSN and NTT for users.
Source code in components/fr/public/user/insurance_profile.py
set_ssn_ntt_on_user ¶
Set the SSN or NTT for an existing user.
Do NOT commit the session.
Source code in components/fr/public/user/insurance_profile.py
member_attributes ¶
has_civil_servant_exemption_justification
module-attribute
¶
has_civil_servant_exemption_justification = MemberAttributeDefinition[
bool
](
name="has_civil_servant_exemption_justification",
display_name="Justificatif de dispense agents publics",
description="Whether the user's account requires civil servant exemption justification",
getter=_get_has_civil_servant_exemption_justification,
raw_type=bool,
)
has_prevoyance_work_stoppages
module-attribute
¶
has_prevoyance_work_stoppages = MemberAttributeDefinition[
bool
](
name="has_prevoyance_work_stoppages",
display_name="Has prevoyance work stoppages",
description="Whether the user has prevoyance work stoppage claims",
getter=_get_has_prevoyance_work_stoppages,
raw_type=bool,
)
has_unpaid_leave_mandatory_coverage
module-attribute
¶
has_unpaid_leave_mandatory_coverage = MemberAttributeDefinition[
bool
](
name="has_unpaid_leave_mandatory_coverage",
display_name="Couverture obligatoire congé sans solde",
description="Whether the user's account has unpaid leave mandatory coverage",
getter=_get_has_unpaid_leave_mandatory_coverage,
raw_type=bool,
)
include_option_billed_to_employee_in_payroll_data
module-attribute
¶
include_option_billed_to_employee_in_payroll_data = MemberAttributeDefinition[
bool
](
name="include_option_billed_to_employee_in_payroll_data",
display_name="Inclure option à la charge du salarié dans la paie",
description="Whether option billed to employee is included in payroll data",
getter=_get_include_option_billed_to_employee_in_payroll_data,
raw_type=bool,
)
is_civil_servant
module-attribute
¶
is_civil_servant = MemberAttributeDefinition[bool](
name="is_civil_servant",
display_name="Is civil servant",
description="Whether the user is a civil servant",
getter=_get_is_civil_servant,
raw_type=bool,
)
is_disabled_ani_billing
module-attribute
¶
is_disabled_ani_billing = MemberAttributeDefinition[bool](
name="is_disabled_ani_billing",
display_name="Facturation ANI désactivée",
description="Whether ANI billing is disabled for the user's account",
getter=_get_is_disabled_ani_billing,
raw_type=bool,
)
is_under_ecology_contract
module-attribute
¶
is_under_ecology_contract = MemberAttributeDefinition[bool](
name="is_under_ecology_contract",
display_name="Contrat écologie",
description="Whether the user is under an ecology contract",
getter=_get_is_under_ecology_contract,
raw_type=bool,
)
termination_letter_sent_at
module-attribute
¶
termination_letter_sent_at = MemberAttributeDefinition[
datetime
](
name="termination_letter_sent_at",
display_name="Termination letter sent at",
description="Timestamp when termination letter was sent",
getter=_get_termination_letter_sent_at,
raw_type=datetime,
)
termination_letter_status
module-attribute
¶
termination_letter_status = MemberAttributeDefinition[str](
name="termination_letter_status",
display_name="Termination letter status",
description="Status of the legacy contract termination letter",
getter=_get_termination_letter_status,
raw_type=str,
)
user_states
module-attribute
¶
user_states = MemberAttributeDefinition[
list[UserStateToDisplay]
](
name="user_states",
display_name="User states",
description="Categorized user states for display",
getter=_get_user_states,
raw_type=list[UserStateToDisplay],
formatter=_format_user_states_to_display,
)
primary_member_attributes ¶
primary_user_company_prevoyance_contracts
module-attribute
¶
primary_user_company_prevoyance_contracts = MemberAttributeDefinition[
list[PrevoyanceContractInfo]
](
name="primary_user_company_prevoyance_contracts",
display_name="Primary user company prevoyance contracts",
description="Active/upcoming prevoyance contracts for the primary user's company",
getter=_get_primary_user_company_prevoyance_contracts,
raw_type=list[PrevoyanceContractInfo],
formatter=_format_prevoyance_contracts,
)
primary_user_professional_category
module-attribute
¶
primary_user_professional_category = MemberAttributeDefinition[
ProfessionalCategory
](
name="primary_user_professional_category",
display_name="Primary user professional category",
description="Professional category of the primary user's active employment",
getter=_get_primary_user_professional_category,
raw_type=ProfessionalCategory,
formatter=_format_professional_category,
)
primary_user_states
module-attribute
¶
primary_user_states = MemberAttributeDefinition[
list[UserStateToDisplay]
](
name="primary_user_states",
display_name="Primary user states",
description="Categorized user states for the primary user (account holder)",
getter=_get_primary_user_states,
raw_type=list[UserStateToDisplay],
formatter=_format_user_states_to_display,
)
queries ¶
EmploymentSearchResult
dataclass
¶
UserSearchResult
dataclass
¶
User data returned by user search queries.
get_user ¶
Get user data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int
|
user id |
required |
Returns:
| Type | Description |
|---|---|
User
|
French user data |
get_user_for_clinic ¶
Get user data for clinic with linked data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int
|
user id |
required |
Returns:
| Type | Description |
|---|---|
User
|
French user data |
Source code in components/fr/public/user/queries.py
get_user_from_email ¶
Source code in components/fr/public/user/queries.py
get_user_pro_email_with_perso_fallback ¶
Get the pro email of the user, falling back to personal email if pro email is not set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int
|
The user ID |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The pro email if available, otherwise the personal email. |
Source code in components/fr/public/user/queries.py
get_users ¶
Get multiple FR users by their IDs in a single database query
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_ids
|
list[int]
|
List of user IDs to fetch |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict[int, User]
|
Dictionary mapping user IDs to User objects with insurance_profile eagerly loaded. |
|
Note |
dict[int, User]
|
If some IDs don't exist, they won't be in the result. |
Source code in components/fr/public/user/queries.py
is_user ¶
search_users_by_invite_email ¶
Search users by their employment invite email.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
invite_email
|
str
|
The invite email to search for. |
required |
Returns:
| Type | Description |
|---|---|
list[UserSearchResult]
|
List of matching users with their employments. |
Source code in components/fr/public/user/queries.py
components.fr.public.validators ¶
ape_validator ¶
ApeValidationError ¶
Bases: Exception
ApeValidator ¶
- Allows to check if a APE code (or NAF) is valid
are_ape_codes_equal
staticmethod
¶
Cleans and validates an APE code (or NAF) and compare them.
NB 1: If either or both values are invalid, returns False. NB 2: If both values are None, returns True.
Source code in components/fr/public/validators/ape_validator.py
validate_ape_code
staticmethod
¶
Cleans and validates an APE code (or NAF) and returns it, else raises an error.
NB: None value is considered as valid.