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.agent_eval ¶
mock_tool_handlers ¶
FR mock-vs-prod tool handlers, mock configs, and per-tool YAML serializers.
Single source of truth for FR agent-tool mocking. The controllers in
components/fr/internal/.../controllers/agent_tools.py import the
*_MOCK_CONFIG constants and _mock_* callbacks from this module and
apply them via the @mock_agent_tool decorator. The compare_mock_to_prod
flow uses the same configs/callbacks via the FR_MOCK_TOOL_HANDLERS
registry below — so the comparison reflects the real eval-run behavior.
FR_MOCK_TOOL_HANDLERS
module-attribute
¶
FR_MOCK_TOOL_HANDLERS = {
"list_care_events": handle_list_care_events,
"get_recent_care_events": handle_list_care_events,
"get_care_event_detail": handle_get_care_event_detail,
"get_recent_insurance_documents": handle_get_recent_insurance_documents,
"get_insurance_document_detail": handle_get_insurance_document_detail,
"get_health_guarantee_short_codes": StatelessMockerHandler(
GET_HEALTH_GUARANTEE_SHORT_CODES_MOCK_CONFIG
),
"get_health_guarantee_details": StatelessMockerHandler(
GET_HEALTH_GUARANTEE_DETAILS_MOCK_CONFIG
),
"terminate_or_cancel_surco_period": StatelessMockerHandler(
TERMINATE_OR_CANCEL_SURCO_PERIOD_MOCK_CONFIG
),
"mark_tp_partial_status_as_paid": StatelessMockerHandler(
MARK_TP_PARTIAL_STATUS_AS_PAID_MOCK_CONFIG
),
"reprocess_request_parsed_document_content": StatelessMockerHandler(
REPROCESS_REQUEST_PARSED_DOCUMENT_CONTENT_MOCK_CONFIG
),
"upload_insurance_document": StatelessMockerHandler(
UPLOAD_INSURANCE_DOCUMENT_MOCK_CONFIG
),
}
GET_HEALTH_GUARANTEE_DETAILS_MOCK_CONFIG
module-attribute
¶
GET_HEALTH_GUARANTEE_DETAILS_MOCK_CONFIG = StatelessMockConfig(
tool_name="get_health_guarantee_details",
default_success_content=[],
arg_validator=_validate_health_guarantee_details_args,
)
GET_HEALTH_GUARANTEE_SHORT_CODES_MOCK_CONFIG
module-attribute
¶
GET_HEALTH_GUARANTEE_SHORT_CODES_MOCK_CONFIG = (
StatelessMockConfig(
tool_name="get_health_guarantee_short_codes",
default_success_content=[],
)
)
MARK_TP_PARTIAL_STATUS_AS_PAID_MOCK_CONFIG
module-attribute
¶
MARK_TP_PARTIAL_STATUS_AS_PAID_MOCK_CONFIG = StatelessMockConfig(
tool_name="mark_tp_partial_status_as_paid",
default_success_content="Successfully marked care event TP partial status as not paid by user.",
)
REPROCESS_REQUEST_PARSED_DOCUMENT_CONTENT_MOCK_CONFIG
module-attribute
¶
REPROCESS_REQUEST_PARSED_DOCUMENT_CONTENT_MOCK_CONFIG = StatelessMockConfig(
tool_name="reprocess_request_parsed_document_content",
default_success_content="Successfully created reprocess request for document.",
)
StatelessMockerHandler
dataclass
¶
Replay each prod call through replay_stateless_mock and diff outputs.
Uses the same StatelessMockConfig the controller decorator applies, so
the comparison reflects the real eval-run behavior.
__call__ ¶
Replay each prod call through the stateless framework and diff outputs.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
TERMINATE_OR_CANCEL_SURCO_PERIOD_MOCK_CONFIG
module-attribute
¶
TERMINATE_OR_CANCEL_SURCO_PERIOD_MOCK_CONFIG = (
StatelessMockConfig(
tool_name="terminate_or_cancel_surco_period",
default_success_content=lambda arg: (
"Surco period successfully updated."
if get("new_end_date")
else "Surco period successfully cancelled."
),
)
)
UPLOAD_INSURANCE_DOCUMENT_MOCK_CONFIG
module-attribute
¶
UPLOAD_INSURANCE_DOCUMENT_MOCK_CONFIG = StatelessMockConfig(tool_name='upload_insurance_document', default_success_content=lambda args: f'Successfully uploaded insurance document ID {args['document_id']}. It will be processed in a few minutes and then show up in the member's profile.')
handle_get_care_event_detail ¶
Replay each prod get_care_event_detail call through the mock and diff outputs.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
handle_get_insurance_document_detail ¶
Replay each prod get_insurance_document_detail call through the mock and diff.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
handle_get_recent_insurance_documents ¶
Replay each prod get_recent_insurance_documents call through the mock and diff.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
handle_list_care_events ¶
Replay each prod list_care_events call through the mock and diff outputs.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
mock_care_event_detail ¶
Return mocked care event detail for the requested id, YAML-formatted.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
mock_insurance_document_detail ¶
Return mocked insurance document detail for the requested id, YAML-formatted.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
mock_list_care_events ¶
Return mocked care events filtered from the typed in-memory store.
Source code in components/fr/public/agent_eval/mock_tool_handlers.py
mock_recent_insurance_documents ¶
Return the recent insurance documents from the typed in-memory store.
Source code in components/fr/public/agent_eval/mock_tool_handlers.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.automated_answer ¶
member_attributes ¶
recent_ai_contacts
module-attribute
¶
recent_ai_contacts = MemberAttributeDefinition[
list[RecentAiContact]
](
name="recent_ai_contacts",
display_name="Recent conversations",
description="Content of the member's recent AI contacts (last 48h, max 2), to detect fast follow-ups",
getter=_get_recent_contacts,
raw_type=list[RecentAiContact],
scope=CONTACTING_MEMBER,
formatter=_format_recent_ai_contacts,
)
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="Âge",
description="Âge actuel du bénéficiaire",
getter=_get_beneficiary_age,
raw_type=int,
scope=BENEFICIARY,
)
beneficiary_birth_date
module-attribute
¶
beneficiary_birth_date = MemberAttributeDefinition[date](
name="beneficiary_birth_date",
display_name="Date de naissance",
description="Indique la date de naissance du membre",
getter=_get_beneficiary_birth_date,
raw_type=date,
scope=BENEFICIARY,
formatter=_format_birth_date,
anonymize=anonymize_birth_date,
)
beneficiary_enrollment_type
module-attribute
¶
beneficiary_enrollment_type = MemberAttributeDefinition[
EnrollmentType
](
name="beneficiary_enrollment_type",
display_name="Type",
description="Rôle dans le contrat (titulaire, conjoint, enfant)",
getter=_get_beneficiary_enrollment_type,
raw_type=EnrollmentType,
scope=BENEFICIARY,
formatter=_format_enrollment_type,
)
beneficiary_full_name
module-attribute
¶
beneficiary_full_name = MemberAttributeDefinition[str](
name="beneficiary_full_name",
display_name="Nom",
description="Nom complet du bénéficiaire",
getter=_get_beneficiary_full_name,
raw_type=str,
scope=BENEFICIARY,
anonymize=anonymize_full_name,
)
enrollment_end_date
module-attribute
¶
enrollment_end_date = MemberAttributeDefinition[date](
name="enrollment_end_date",
display_name="Date de fin de la couverture",
description="Date prévue de fin de couverture",
getter=_get_enrollment_end_date,
raw_type=date,
scope=BENEFICIARY,
)
enrollment_start_date
module-attribute
¶
enrollment_start_date = MemberAttributeDefinition[date](
name="enrollment_start_date",
display_name="Date de début de la couverture",
description="Date d'entrée en vigueur de la couverture avec ancienneté calculée",
getter=_get_enrollment_start_date,
raw_type=date,
scope=BENEFICIARY,
)
enrollment_termination_type
module-attribute
¶
enrollment_termination_type = MemberAttributeDefinition[
EnrollmentTerminationType
](
name="enrollment_termination_type",
display_name="Raison de fin de couverture du bénéficiaire",
description="Indique la raison pour la laquelle la couverture santé du bénéficiaire s'est terminée",
getter=_get_enrollment_termination_type,
raw_type=EnrollmentTerminationType,
scope=BENEFICIARY,
formatter=_format_enrollment_termination_type,
)
member_attributes ¶
BeneficiaryEligibilityExtension
dataclass
¶
ContractRegime ¶
EmailAddresses
dataclass
¶
Bases: DataClassJsonMixin
Email addresses associated with a beneficiary.
SurcomplementairePeriodInfo
dataclass
¶
beneficiary_eligibility_extension
module-attribute
¶
beneficiary_eligibility_extension = MemberAttributeDefinition[
BeneficiaryEligibilityExtension
](
name="beneficiary_eligibility_extension",
display_name="Extension de l'éligibilité bénéficiaire",
description="Raison de prolongation exceptionnelle de la couverture au-delà des conditions standard",
getter=_get_beneficiary_eligibility_extension,
raw_type=BeneficiaryEligibilityExtension,
scope=BENEFICIARY,
formatter=_format_beneficiary_eligibility_extension,
)
beneficiary_email_addresses
module-attribute
¶
beneficiary_email_addresses = MemberAttributeDefinition[
EmailAddresses
](
name="beneficiary_email_addresses",
display_name="Adresse mail du bénéficiaire",
description="Indique le ou les adresses mails utilisées par le bénéficiaires pour la gestion de son compte Alan",
getter=_get_beneficiary_email_addresses,
raw_type=EmailAddresses,
scope=BENEFICIARY,
formatter=_format_beneficiary_email_addresses,
)
contract_regime
module-attribute
¶
contract_regime = MemberAttributeDefinition[ContractRegime](
name="contract_regime",
display_name="Régime",
description="Régime de Sécurité Sociale du bénéficiaire (Général ou spécifique comme Alsace-Moselle)",
getter=_get_contract_regime,
raw_type=ContractRegime,
scope=BENEFICIARY,
formatter=_format_contract_regime,
)
is_alan_on_surco
module-attribute
¶
is_alan_on_surco = MemberAttributeDefinition[bool](
name="is_alan_on_surco",
display_name="Alan est en surcomplementaire",
description='Indique si le membre est en surcomplémentaire avec Alan. Si la réponse est "oui", Alan n\'est pas la mutuelle principale',
getter=_get_is_alan_on_surco,
raw_type=bool,
scope=BENEFICIARY,
)
is_april_abroad_coverage
module-attribute
¶
is_april_abroad_coverage = MemberAttributeDefinition[bool](
name="is_april_abroad_coverage",
display_name="Couverture à l'étranger par April",
description='Indique si les remboursements du membre sont gérés par April plutôt que par Alan, ce qui est le cas des membres résidant à l\'étranger. Si la réponse est "oui", le membre est couvert par April pour ses remboursements.',
getter=_get_is_april_abroad_coverage,
raw_type=bool,
scope=BENEFICIARY,
)
is_attestation_de_droits_uploaded
module-attribute
¶
is_attestation_de_droits_uploaded = MemberAttributeDefinition[
bool
](
name="is_attestation_de_droits_uploaded",
display_name="Attestation de droits partagée",
description="Indique si une attestation de droits a été partagée sur le compte du membre",
getter=_get_is_attestation_de_droits_uploaded,
raw_type=bool,
scope=BENEFICIARY,
)
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="Date de la dernière attestation de droits",
description="Indique la date de la dernière attestation de droits que nous avons reçue",
getter=_get_last_date_of_attestation_de_droits,
raw_type=date,
scope=BENEFICIARY,
)
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="Date de la dernière demande de connexion NOEMIE",
description="Indique la date à laquelle une demande de connexion à Noémie a été lancée. Cette information aura pour valeur N/A lorsqu’aucune demande de connexion n’a été faite.",
getter=_get_last_date_of_noemie_connection_request,
raw_type=date,
scope=BENEFICIARY,
)
reimbursement_iban
module-attribute
¶
reimbursement_iban = MemberAttributeDefinition[str](
name="reimbursement_iban",
display_name="IBAN de remboursement",
description="Coordonnées bancaires utilisées pour les remboursements",
getter=_get_reimbursement_iban,
raw_type=str,
scope=BENEFICIARY,
anonymize=anonymize_iban,
)
surcomplementaire_period
module-attribute
¶
surcomplementaire_period = MemberAttributeDefinition[
SurcomplementairePeriodInfo
](
name="surcomplementaire_period",
display_name="Période couverte par la surcomplémentaire",
description="Indique la période pendant laquelle le membre a un statut de surcomplémentaire activé avec Alan",
getter=_get_surcomplementaire_period,
raw_type=SurcomplementairePeriodInfo,
scope=BENEFICIARY,
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="Solde du compte",
description="",
getter=_get_contract_billing_balance_in_euro_cents,
raw_type=int,
scope=CONTACTING_MEMBER,
formatter=_format_billing_balance,
)
billing_information
module-attribute
¶
billing_information = MemberAttributeDefinition(
name="billing_information",
display_name="Information de la facturation",
description="Donne des informations sur l'état de la facturation directe (mode de paiement, type de contrat, recouvrement...)",
getter=_get_billing_information,
raw_type=dict[ContractType, BillingInformation],
scope=CONTACTING_MEMBER,
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
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 ¶
PecRequestAttribute
dataclass
¶
PecRequestAttribute(
status,
pec_date=isodate_field(),
pec_id=None,
request_type=None,
health_professional_name=None,
rejection_reason_code=None,
is_fraud_confirmed=False,
)
Bases: DataClassJsonMixin
Tiers-payant PEC request snapshot for support context.
PrescriptionAttribute
dataclass
¶
PrescriptionAttribute(
prescription_date=optional_isodate_field(default=None),
right_lense_content=None,
left_lense_content=None,
)
Bases: DataClassJsonMixin
Glasses prescription details for support context.
RemainingAmountUsage
dataclass
¶
RemainingCountUsage
dataclass
¶
TeletransmissionStatusInfo
dataclass
¶
Bases: DataClassJsonMixin
Teletransmission status with associated caisse info.
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="Informations sur le Care Event dont parle le membre",
description="Details about the Care Event the member is contacting us about",
getter=_get_care_event_details,
raw_type=CareEventDetailsForSupportAiAssistant,
scope=CONTACTING_MEMBER,
formatter=_format_care_event_details,
anonymize=_anonymize_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="Forfait lentilles restant",
description="Indique la valeur du forfait de lentilles au moment de la conversation",
getter=_get_contact_lenses_forfait_remaining_and_limit,
raw_type=dict[
str, RemainingCountUsage | RemainingAmountUsage
],
scope=BENEFICIARY,
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="Historique des demandes de prise en charge pour lentilles",
description="Indique l’historique des demandes de prise en charge de lentilles du bénéficiaire. Pour chaque demande de prise en charge, on indique le statut, la date de la demande, l’opticien qui a fait la demande ainsi que la raison du refus si la demande a été refusée. Une prise en charge Acknowledged utilise le forfait.",
getter=_get_contact_lenses_pec_requests,
raw_type=list[PecRequestAttribute],
scope=BENEFICIARY,
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="Liste des ordonnances pour lentilles partagées par le bénéficiaire et traitées par Alan",
description="Indique la date de la consultation (et non pas la date de réception du document) ainsi que la correction des sphères et cylindres sur les deux yeux, pour les lentilles.",
getter=_get_contact_lenses_prescription_dates,
raw_type=list[PrescriptionAttribute],
scope=BENEFICIARY,
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
get_last_date_of_refunded_care_event ¶
Return care_date of the most recent care event with refunded status.
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="Forfait lunettes restant",
description="Indique la valeur du forfait de lunettes au moment de la conversation",
getter=_get_glasses_forfait_remaining_and_limit,
raw_type=dict[
str, RemainingCountUsage | RemainingAmountUsage
],
scope=BENEFICIARY,
formatter=_format_remaining_usage_glasses,
)
glasses_pec_requests
module-attribute
¶
glasses_pec_requests = MemberAttributeDefinition[
list[PecRequestAttribute]
](
name="glasses_pec_requests",
display_name="Historique des demandes de prise en charge pour lunettes",
description="Indique l’historique des demandes de prise en charge de lunettes du bénéficiaire. Pour chaque demande de prise en charge, on indique le statut, la date de la demande, l’opticien qui a fait la demande ainsi que la raison du refus si la demande a été refusée. Une prise en charge Acknowledged utilise le forfait.",
getter=_get_glasses_pec_requests,
raw_type=list[PecRequestAttribute],
scope=BENEFICIARY,
formatter=_format_glasses_pec_requests,
anonymize=_anonymize_glasses_pec_requests,
)
glasses_prescription_dates
module-attribute
¶
glasses_prescription_dates = MemberAttributeDefinition[
list[PrescriptionAttribute]
](
name="glasses_prescription_dates",
display_name="Liste des ordonnances pour lunettes partagées par le bénéficiaire et traitées par Alan",
description="Indique la date de la consultation (et non pas la date de réception du document) ainsi que la correction des sphères et cylindres sur les deux yeux, pour les lunettes..",
getter=_get_glasses_prescription_dates,
raw_type=list[PrescriptionAttribute],
scope=BENEFICIARY,
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="Informations sur le document dont parle le membre",
description="Informations sur le document au sujet duquel le membre nous contacte",
getter=_get_insurance_document_details,
raw_type=ParsedDocumentContentForSupportAiAssistant,
scope=CONTACTING_MEMBER,
formatter=_format_insurance_document_details,
anonymize=_anonymize_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="Le membre fait partie de l'Entreprise Pilot",
description="Si le membre fait partie ou non du pilote de surconsommation",
getter=_get_is_enterprise_overconsumption_pilot_member,
raw_type=bool,
scope=BENEFICIARY,
)
last_care_date
module-attribute
¶
last_care_date = MemberAttributeDefinition[date](
name="last_care_date",
display_name="Date du dernier remboursement",
description="Indique la date à laquelle le dernier remboursement a eu lieu sur le compte du membre. « N/A » signifie qu'il n'y a pas eu de remboursement.",
getter=_get_last_care_date,
raw_type=date,
scope=BENEFICIARY,
)
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="Date du dernier achat de lentilles",
description="La date du dernier achat de lentilles du bénéficiaire remboursées par Alan.",
getter=_get_last_date_of_contact_lenses_purchase,
raw_type=date,
scope=BENEFICIARY,
)
last_date_of_glasses_purchase
module-attribute
¶
last_date_of_glasses_purchase = MemberAttributeDefinition[
date
](
name="last_date_of_glasses_purchase",
display_name="Date du dernier achat de lunettes du bénéficiaire",
description="La date du dernier achat de lunettes du bénéficiaire remboursées par Alan.",
getter=_get_last_date_of_glasses_purchase,
raw_type=date,
scope=BENEFICIARY,
)
last_refunded_care_date
module-attribute
¶
last_refunded_care_date = MemberAttributeDefinition[date](
name="last_refunded_care_date",
display_name="Date du dernier remboursement par Alan",
description="Indique la date à laquelle le dernier remboursement venant d'Alan a eu lieu sur le compte du membre. « N/A » signifie qu'il n'y a pas eu de remboursement.",
getter=_get_last_refunded_care_date,
raw_type=date,
scope=BENEFICIARY,
)
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="Date du dernier achat de lunettes déclarée par l'ancien assureur",
description="La date à laquelle ils ont acheté leurs dernières lunettes remboursées par leur ancien assureur.",
getter=_get_previous_glasses_purchase_date_from_previous_insurer,
raw_type=date,
scope=BENEFICIARY,
)
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="Devis spécifique",
description="Indique les informations clés du devis traité. Cet attribut donne des informations sur le devis, la date de téléchargement, le statut, la raison du rejet, le contenu traité par nos équipes et l'estimation qui en resulte.",
getter=_get_quote_document_details,
raw_type=QuoteDocumentInfo,
scope=CONTACTING_MEMBER,
)
teletransmission_status
module-attribute
¶
teletransmission_status = MemberAttributeDefinition[
TeletransmissionStatusInfo
| list[TeletransmissionStatusInfo]
](
name="teletransmission_status",
display_name="Statut de la télétransmission",
description="Indique le statut actuel de la télétransmission du membre",
getter=_get_teletransmission_status,
raw_type=TeletransmissionStatusInfo
| list[TeletransmissionStatusInfo],
scope=BENEFICIARY,
formatter=_format_teletransmission_status,
)
components.fr.public.clinic ¶
adapter ¶
FrClinicAdapter ¶
Bases: ClinicAdapter
build_new_medical_chat_deeplink ¶
Build a deeplink to open a new medical chat.
Source code in components/fr/public/clinic/adapter.py
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
create_optician_out_of_shop_auth_marmot_comment ¶
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_company ¶
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_custom_session_configurations ¶
FR session configurations: single default per session type.
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 ¶
get_shop_products ¶
Source code in components/fr/public/clinic/adapter.py
has_access_to_orientation_call ¶
has_app_user_permission ¶
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
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
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 | |
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 ¶
entities ¶
CompanyEntity
dataclass
¶
CompanyEntity(
company_id,
name,
display_name,
siren,
nic,
registered_office_nic,
ape,
account_id,
created_at,
)
Bases: DataClassJsonMixin
Generic public metadata for an FR company.
Identity + naming + SIREN/NIC + activity code + owning account + creation time. Intentionally metadata-only: no contracts, employees, billing, etc. Consumers that need related data call the dedicated public queries for those concerns. Modelled to serve many read use cases, not one in particular.
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_companies_metadata ¶
Return generic metadata for the given company IDs.
Unknown IDs are skipped silently (never raises), mirroring the tolerant behavior of get_company_names_by_ids: callers get back only the companies that exist.
Source code in components/fr/internal/business_logic/company/queries/company_metadata.py
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 ¶
entities ¶
ContractEntity
dataclass
¶
ContractEntity(
contract_id,
company_id,
nature,
status,
is_signed,
start_date,
end_date,
is_collective_retirees,
created_at,
issued_date,
)
Bases: DataClassJsonMixin
Generic public metadata for an FR company contract (health or prevoyance).
Hides the structural differences between the Contract and PrevoyanceContract ORM models behind one neutral shape. Metadata-only: no coverage, no plan, no versions, no participation. Only carries fields shared by both contract types, so it can serve many read use cases, not one in particular. Widen later only if a real cross-component need appears.
member_attributes ¶
MemberAttributePrevoyanceContractEnd
dataclass
¶
Bases: DataClassJsonMixin
The end of the member's current prévoyance contract. end_date is None when the
contract is open-ended (tacit renewal). The attribute is absent (N/A) only when the
member is not covered — so the agent can tell "open-ended" from "not covered".
company_name
module-attribute
¶
company_name = MemberAttributeDefinition[str](
name="company_name",
display_name="Nom de l'entreprise",
description="Nom de l'entreprise employant le membre contactant",
getter=_get_company_name,
raw_type=str,
scope=CONTACTING_MEMBER,
)
contract_end_date
module-attribute
¶
contract_end_date = MemberAttributeDefinition[date](
name="contract_end_date",
display_name="Date de fin de contrat",
description="Date de fin du contrat du membre (contrat collectif d'entreprise ou contrat individuel)",
getter=_get_contract_end_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
contract_has_madelin_attestation_available
module-attribute
¶
contract_has_madelin_attestation_available = MemberAttributeDefinition[
bool
](
name="contract_has_madelin_attestation_available",
display_name="Attestation Madelin disponible",
description="Indique si l'attestation fiscale Madelin est disponible pour le membre TNS",
getter=_get_contract_has_madelin_attestation_available,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
contract_start_date
module-attribute
¶
contract_start_date = MemberAttributeDefinition[date](
name="contract_start_date",
display_name="Date de début du contrat",
description="Date de début du contrat du membre (contrat collectif d'entreprise ou contrat individuel). Pour les contrats individuels, cette date détermine la période d'engagement de 12 mois.",
getter=_get_contract_start_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
contract_type
module-attribute
¶
contract_type = MemberAttributeDefinition[ContractPlanInfo](
name="contract_type",
display_name="",
description="",
getter=_get_contract_type,
raw_type=ContractPlanInfo,
scope=CONTACTING_MEMBER,
formatter=_format_contract_type,
)
format_prevoyance_contract_end ¶
Render the prévoyance contract end for the support AI prompt.
Source code in components/fr/public/contract/member_attributes.py
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="L'employeur a mis en place un dispositif de solidarité pour les cotisations enfants",
description="Indique si l'employeur du membre dispose d'un dispositif de solidarité permettant de réduire les cotisations des enfants en fonction des revenus du parent. Ce mécanisme est financé par le fonds d'accompagnement social.",
getter=_get_has_income_based_children_discount_rules,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
health_contract_coverage
module-attribute
¶
health_contract_coverage = MemberAttributeDefinition[
HealthContractCoverageInfo
](
name="health_contract_coverage",
display_name="Détails des statuts bénéficiaires",
description="Fournit les informations sur le contrat du membre",
getter=_get_health_contract_coverage,
raw_type=HealthContractCoverageInfo,
scope=CONTACTING_MEMBER,
formatter=_format_health_contract_coverage,
)
health_contract_status
module-attribute
¶
health_contract_status = MemberAttributeDefinition[
HealthContractStatusInfo
](
name="health_contract_status",
display_name="Statut du contrat santé de l'entreprise",
description="Indique si le contrat santé de l'entreprise est actif, en cours d'activation, ou inactif",
getter=_get_health_contract_status,
raw_type=HealthContractStatusInfo,
scope=CONTACTING_MEMBER,
formatter=_format_health_contract_status,
)
individual_contract_amendment_history
module-attribute
¶
individual_contract_amendment_history = MemberAttributeDefinition[
list[IndividualContractAmendmentDetail]
](
name="individual_contract_amendment_history",
display_name="Historique des avenants au contrat individuel du membre",
description='Historique de toutes les avenants existant sur le contrat individuel du membre, indiquant les modifications de couverture et de tarification. "Upgrade" indique que le membre a décidé d\'améliorer son offre, "renouvellement" indique une modification obligatoire de la tarification dans le cadre du renouvellement annuel des contrats.',
getter=_get_individual_contract_amendment_history,
raw_type=list[IndividualContractAmendmentDetail],
scope=CONTACTING_MEMBER,
formatter=_format_individual_contract_amendment_history,
)
individual_plan_name
module-attribute
¶
individual_plan_name = MemberAttributeDefinition[str](
name="individual_plan_name",
display_name="Individual plan name",
description="Nom du plan pour les contrats individuels (TNS, Individuel, Dolce Vita, Alan Proxima, Alan Silver)",
getter=_get_individual_plan_name,
raw_type=str,
scope=CONTACTING_MEMBER,
)
is_direct_billing
module-attribute
¶
is_direct_billing = MemberAttributeDefinition[bool](
name="is_direct_billing",
display_name="Facturation directe de la cotisation des bénéficiaires",
description="Indique si la cotisation des bénéficiaires est facturée directement au primaire (vs prélevée sur salaire)",
getter=_get_is_direct_billing,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
is_direct_billing_of_options
module-attribute
¶
is_direct_billing_of_options = MemberAttributeDefinition[
bool
](
name="is_direct_billing_of_options",
display_name="Facturation directe des options",
description="Indique si les options sont facturées directement au membre (vs prélevées sur salaire)",
getter=_get_is_direct_billing_of_options,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
plan_number_of_options
module-attribute
¶
plan_number_of_options = MemberAttributeDefinition[int](
name="plan_number_of_options",
display_name="Nombre d'options disponibles pour les salariés",
description="Nombre de formules optionnelles proposées en complément du contrat de base",
getter=_get_plan_number_of_options,
raw_type=int,
scope=CONTACTING_MEMBER,
)
prevoyance_contract_end_date
module-attribute
¶
prevoyance_contract_end_date = MemberAttributeDefinition[
MemberAttributePrevoyanceContractEnd
](
name="prevoyance_contract_end_date",
display_name="Date de fin du contrat prévoyance actuel",
description="Indique la date de fin du contrat prévoyance actif de l'entreprise. « Sans échéance (reconduction tacite) » si le contrat n'a pas de date de fin ; vide (N/A) uniquement si le membre n'est pas couvert.",
getter=_get_prevoyance_contract_end_date,
raw_type=MemberAttributePrevoyanceContractEnd,
formatter=format_prevoyance_contract_end,
scope=CONTACTING_MEMBER,
)
prevoyance_contract_start_date
module-attribute
¶
prevoyance_contract_start_date = MemberAttributeDefinition[
date
](
name="prevoyance_contract_start_date",
display_name="Date de début du contrat prévoyance actuel",
description="Indique la date de début du contrat prévoyance actif de l'entreprise",
getter=_get_prevoyance_contract_start_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
option_member_attributes ¶
Member attribute definitions for FR contract option attributes.
ContractOptionStatus ¶
Bases: AlanBaseEnum
Subscription status of a contract option for a member.
contract_option
module-attribute
¶
contract_option = MemberAttributeDefinition[int](
name="contract_option",
display_name="Option souscrite par le membre",
description="Niveau d'option actuellement choisie par le membre",
getter=_get_contract_option,
raw_type=int,
scope=CONTACTING_MEMBER,
)
contract_option_end_date
module-attribute
¶
contract_option_end_date = MemberAttributeDefinition[date](
name="contract_option_end_date",
display_name="Date de fin de l’option",
description="Indique la date de fin de contrat pour l'option souscrite par le membre titulaire",
getter=_get_contract_option_end_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
contract_option_info
module-attribute
¶
contract_option_info = MemberAttributeDefinition[
ContractOptionStatus
](
name="contract_option_info",
display_name="Option de contrat",
description="Indique si le contrat propose une option, et si elle a été souscrite ou non",
getter=_get_contract_option_info,
raw_type=ContractOptionStatus,
scope=CONTACTING_MEMBER,
formatter=_format_contract_option_info,
)
contract_option_start_date
module-attribute
¶
contract_option_start_date = MemberAttributeDefinition[
date
](
name="contract_option_start_date",
display_name="Date de début de l’option",
description="Indique la date de début de contrat pour l'option souscrite par le membre titulaire",
getter=_get_contract_option_start_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
queries ¶
contract_metadata ¶
get_health_contracts_metadata_for_companies ¶
Return generic metadata for all HEALTH contracts of the given companies.
By default returns every health contract regardless of status. Pass statuses
to keep only contracts whose status is in the given set (no filter by default).
Source code in components/fr/internal/business_logic/contract/queries/contract_metadata.py
get_prevoyance_contracts_metadata_for_companies ¶
Return generic metadata for all PREVOYANCE contracts of the given companies.
PrevoyanceContract has no company_id column, so contracts are reached through
Company.prevoyance_contracts and each entity's company_id is taken from the
company walked. By default returns every prevoyance contract regardless of
status. Pass statuses to keep only contracts whose status is in the given
set (no filter by default).
Source code in components/fr/internal/business_logic/contract/queries/contract_metadata.py
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
prevoyance_coverage ¶
get_current_prevoyance_contract_end_date_for_member ¶
End date of the active prévoyance contract matching the member's
population (cadre / non-cadre / CCN) at company_id on on_date (today by
default).
Returns None when the member is uncovered, or when the covering contract
is open-ended (no scheduled end). When several contracts cover the member, an
open-ended one makes the coverage open-ended (None); otherwise the latest
end date is returned.
Source code in components/fr/public/contract/queries/prevoyance_coverage.py
get_current_prevoyance_contract_start_date_for_member ¶
Start date of the active prévoyance contract matching the member's
population (cadre / non-cadre / CCN) at company_id on on_date (today by
default), or None if uncovered.
Source code in components/fr/public/contract/queries/prevoyance_coverage.py
get_current_prevoyance_coverage_end_date_per_company ¶
Per covering company, the (company_name, continuous_coverage_end) for the
member on on_date (today by default), sorted by name, or None if uncovered.
continuous_coverage_end is None when the coverage is open-ended (ongoing).
One entry per company for concurrent employments; the latest end is kept per
company, and any open-ended period makes the whole company's coverage open-ended.
Source code in components/fr/public/contract/queries/prevoyance_coverage.py
get_current_prevoyance_coverage_start_date_per_company ¶
Per covering company, the (company_name, continuous_coverage_start) for
the member on on_date (today by default), sorted by name, or None if
uncovered. One entry per company for concurrent employments; earliest start
kept per company.
Source code in components/fr/public/contract/queries/prevoyance_coverage.py
get_prevoyance_coverage_per_user_and_company ¶
Return the (user_id, company_id) pairs covered by an active prévoyance
contract on on_date (defaults to today).
Granular per-employment: a user covered on only some of their companies appears as one entry per covered company, not as a single "covered" flag. Expired or future eligibilities are dropped.
Source code in components/fr/public/contract/queries/prevoyance_coverage.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_or_ntt_resolver ¶
MissingSsnOrNttResolver ¶
Bases: AdminErrorResolver
Resolver for missing required SSN or NTT core blocked movements.
These occur deeper than the upstream parsing layer: an employment change
reaches the FR health-insurance-affiliation consumer still without an SSN
or NTT, which raises MissingRequiredSsnOrNttError and produces a
CoreBlockedMovement.
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 SSN or NTT core 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_or_ntt_resolver.py
can_resolve ¶
Only core blocked movements can be resolved.
Source code in components/fr/public/employment/admin_resolvers/missing_ssn_or_ntt_resolver.py
get_resolution_context ¶
Return resolution data for a missing SSN/NTT core blocked movement.
Extracts employee information from the blocked movement's employment declaration and defines display fields for the admin.
Source code in components/fr/public/employment/admin_resolvers/missing_ssn_or_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.
employment_values_checker_consumer ¶
fr_employment_values_checker_consumer ¶
Source code in components/fr/public/employment/employment_values_checker_consumer.py
fr_contract_type ¶
FrEmploymentContractType ¶
Bases: AlanBaseEnum
Kind of "contract" a French employee has with their company.
Stored as an infinite extended value on French employments. Subclasses
AlanBaseEnum (i.e. str) like the other extended-value enums so it
serializes natively into the dict[str, str | None] extended values.
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
backfill_user_employments ¶
Source code in components/fr/public/employment/fr_country_gateway.py
build_termination_ingestion ¶
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_affiliation_items_related_to_employment ¶
Source code in components/fr/public/employment/fr_country_gateway.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
get_blocked_invitations_validation_broadcast_id ¶
get_blocked_movement_custom_filters ¶
Source code in components/fr/public/employment/fr_country_gateway.py
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_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_termination_type_options ¶
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.
non_salarie_helpers ¶
has_affiliation_object_for_employment ¶
Whether a policy, exemption or unpaid leave overlaps the employment.
Source code in components/fr/public/employment/non_salarie_helpers.py
should_ignore_employment_change_for_non_salarie ¶
Whether the FR health-affiliation and operational-scope consumers should completely ignore this employment change.
Non-salarié employments (interns, mandataires sociaux) are stored in the Employment Component for Occupational Health, but must not trigger any health-affiliation or operational-scope side effect by default. We only process them when an affiliation object (policy, exemption, unpaid leave) already exists for the employment — e.g. an intern who opted into coverage, so that terminating them still terminates their policy.
Source code in components/fr/public/employment/non_salarie_helpers.py
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 ¶
member_attributes ¶
FR fraud-detection member attributes exposed to AI support agents.
recent_fraud_investigations
module-attribute
¶
recent_fraud_investigations = MemberAttributeDefinition[
RecentFraudInvestigationsSupportInfo
](
name="recent_fraud_investigations",
display_name="Recent fraud investigations",
description="Recent fraud investigations on the member's policy, with the cares under investigation, the outcome and the documents we still await — explains otherwise-puzzling reimbursement delays.",
getter=_get_recent_fraud_investigations,
raw_type=RecentFraudInvestigationsSupportInfo,
scope=CONTACTING_MEMBER,
)
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 ¶
count_pending_admin_invitations ¶
Count pending local (company-level) admin invitations for FR.
Source code in components/fr/public/global_customer_dashboard/admin.py
get_admined_entities_for_entity_selector_fr ¶
Source code in components/fr/public/global_customer_dashboard/admin.py
get_oldest_active_admin_user_id ¶
Return user_id of the oldest active admin for a company, or None.
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. |
Raises:
| Type | Description |
|---|---|
invalid_arguments
|
If the target user has no email address available for the requested role. |
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
port_reimbursement_blockers_as_needed_for_siren ¶
Called when a Company's SIREN changes. Installs a pending_company_kyc blocker on the new SIREN when neither the new SIREN nor the Company itself has a recent approved KYC — i.e. when the SIREN change would otherwise let the Company escape KYC scrutiny.
The install action itself short-circuits when an active blocker for the same reason and span already exists, so we don't need to dedupe here.
Source code in components/fr/internal/kyc/business_logic/actions/reimbursement_blocker.py
port_reimbursement_blockers_as_needed_for_ssn ¶
When an InsuranceProfile’s SSN changes, we don’t want the user to escape a preexisting blocker on its old SSN through the change. -> We check if a blocker was present on the old SSN, and if yes, if it is still justified (no IdVerificationRequest passed). If so, we block the new SSN as well.
We can call this function wherever an InsuranceProfile’s SSN changes.
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
is_siren_valid ¶
Check if a SIREN number is valid (9 digits, Luhn checksum, not all zeros).
Source code in components/fr/internal/kyc/business_logic/helpers/siren.py
components.fr.public.member_attributes ¶
getter_decorators ¶
Decorators that resolve a global UserProfile into FR-specific models for member attribute getters.
Each decorator accepts the universal getter signature (*, profile, context)
and resolves the appropriate model before forwarding to the wrapped getter.
uses_care_event ¶
Context -> care_event_id. Resolves + access-checks, injects care_event=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_contract ¶
Profile -> FR Contract. Injects contract=.
Source code in components/fr/public/member_attributes/getter_decorators.py
uses_fr_enrollment ¶
Profile -> current FR Enrollment. Injects enrollment=.
Backward compatible with the legacy builder, which passes enrollment= directly:
when enrollment is provided it's used as-is; otherwise it's resolved from
profile (which the new builder injects via signature introspection).
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
uses_insurance_document ¶
Context -> insurance_document_id. Resolves + scope-checks, injects insurance_document=.
Source code in components/fr/public/member_attributes/getter_decorators.py
resolvers ¶
Resolve a global UserProfile into FR-specific models.
These are internal implementation details of the getter decorators and should not be imported directly by other components.
resolve_care_event_in_scope ¶
Resolve care_event_id, returning None if the user cannot access it.
Source code in components/fr/public/member_attributes/resolvers.py
resolve_contract ¶
UserProfile -> FR Contract (via current policy).
resolve_current_enrollment ¶
UserProfile -> the most recent FR Enrollment for the user's insurance profile.
Returns the active enrollment when there is one, otherwise the latest by
start_date (covers ended/terminated cases — matches the legacy builder,
which iterates every enrollment in user.beneficiaries regardless of
active status).
Source code in components/fr/public/member_attributes/resolvers.py
resolve_current_policy ¶
UserProfile -> FR current Policy.
resolve_insurance_document_in_scope ¶
Resolve insurance_document_id, returning None if out of scope for the user.
Source code in components/fr/public/member_attributes/resolvers.py
resolve_insurance_profile ¶
UserProfile -> FR InsuranceProfile.
resolve_option_settings ¶
UserProfile -> FR PolicyOptionSettings (via current policy).
Source code in components/fr/public/member_attributes/resolvers.py
resolve_primary_user ¶
UserProfile -> FR primary User (via policy.primary_profile).
Source code in components/fr/public/member_attributes/resolvers.py
resolve_user ¶
UserProfile -> FR User via user_id PK lookup.
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="Statut du justificatif sur la durée de l’emploi précédent",
description="",
getter=_get_ani_employment_duration_justification_requirement,
raw_type=AniEmploymentDurationJustificationRequirement,
scope=CONTACTING_MEMBER,
formatter=_format_ani_employment_duration_justification_requirement,
)
ani_entry_date
module-attribute
¶
ani_entry_date = MemberAttributeDefinition[date](
name="ani_entry_date",
display_name="Date de début de la portabilité",
description="Date à laquelle la portabilité a ou va commencer",
getter=_get_ani_entry_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
ani_justification_rejection_reason
module-attribute
¶
ani_justification_rejection_reason = MemberAttributeDefinition[
JustificationRejectionStatus
](
name="ani_justification_rejection_reason",
display_name="Raison du rejet du justificatif de portabilité",
description="Raison pour laquelle le justificatif a été rejeté pour un mois donné",
getter=_get_ani_justification_rejection_reason,
raw_type=JustificationRejectionStatus,
scope=CONTACTING_MEMBER,
formatter=_format_ani_justification_rejection_reason,
)
ani_justification_requirement
module-attribute
¶
ani_justification_requirement = MemberAttributeDefinition[
AniJustificationRequirement
](
name="ani_justification_requirement",
display_name="Statut des justificatifs de portabilité",
description="Statut des justificatifs de portabilité",
getter=_get_ani_justification_requirement,
raw_type=AniJustificationRequirement,
scope=CONTACTING_MEMBER,
formatter=_format_ani_justification_requirement,
)
ani_justification_status_history
module-attribute
¶
ani_justification_status_history = MemberAttributeDefinition(
name="ani_justification_status_history",
display_name="Statuts des justificatifs de portabilité",
description="Historique mensuelle des statuts de portabilité du début de la portabilité du titulaire jusqu’à aujourd’hui. Pour chaque justificatif, on explique s’il est valide ou non, et s’il ne l’est pas on explique pourquoi. Pour chaque justificatif, il y a aussi de l’information sur comment le document a été traité : automatiquement, manuellement ou par France Travail ainsi que la date du traitement du document.",
getter=_get_ani_justification_status_history,
raw_type=dict[str, AniJustificationStatusToDisplay],
scope=CONTACTING_MEMBER,
formatter=_format_ani_justification_status_history,
)
ani_payslip_status_history
module-attribute
¶
ani_payslip_status_history = MemberAttributeDefinition(
name="ani_payslip_status_history",
display_name="Statut de la dernière fiches de paie",
description="Statut de la dernière fiche de paie partagée par le membre. Il peut y en avoir plusieurs si le membre a fait plusieurs tentatives de partage.",
getter=_get_ani_payslip_status_history,
raw_type=list[AniPayslipStatusToDisplay],
scope=CONTACTING_MEMBER,
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="Date de fin de la portabilité",
description="Date à laquelle le membre la portabilité va prendre fin. C’est vide si jamais la date n’a pas encore été calculée.",
getter=_get_max_ani_end_date,
raw_type=date,
scope=CONTACTING_MEMBER,
)
exemption ¶
member_attributes ¶
exemption_justification_rejection_reason
module-attribute
¶
exemption_justification_rejection_reason = MemberAttributeDefinition[
ExemptionJustificationRejectionReason
](
name="exemption_justification_rejection_reason",
display_name="Raison du rejet du justificatif de dispense",
description="",
getter=_get_exemption_justification_rejection_reason,
raw_type=ExemptionJustificationRejectionReason,
scope=CONTACTING_MEMBER,
formatter=_format_exemption_justification_rejection_reason,
)
exemption_justification_status
module-attribute
¶
exemption_justification_status = MemberAttributeDefinition[
JustificationStatus
](
name="exemption_justification_status",
display_name="Statut du justificatif de dispense",
description="Statut du justificatif de dispense (valide ou non)",
getter=_get_exemption_justification_status,
raw_type=JustificationStatus,
scope=CONTACTING_MEMBER,
)
exemption_status
module-attribute
¶
exemption_status = MemberAttributeDefinition[
ExemptionOnboardingStatus
](
name="exemption_status",
display_name="Statut de la dispense",
description="Statut de la dispense (complétée, commencée...)",
getter=_get_exemption_status,
raw_type=ExemptionOnboardingStatus,
scope=CONTACTING_MEMBER,
)
recent_exemptions
module-attribute
¶
recent_exemptions = MemberAttributeDefinition[
list[ExemptionMemberAttribute]
](
name="recent_exemptions",
display_name="Dispense Récente",
description="Liste les dates et le statut des dispenses précédentes, et indique si elle est renouvelable ou non.",
getter=_get_recent_exemptions,
raw_type=list[ExemptionMemberAttribute],
scope=CONTACTING_MEMBER,
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
factories ¶
queries ¶
get_operationalscope_name_by_company_and_value ¶
Map each company's scope values (NIC or entity code) to operational scope names.
Outer key is the company_id, inner key is the stripped scope value. Keying by company prevents collisions when two companies share a scope value (e.g. the same establishment NIC). Returns the group's name if the scope belongs to a group, otherwise the scope's own name.
Scope values are stripped so a whitespace-padded stored value still matches a clean lookup key. This whitespace-insensitive keying is specific to this consumer; get_scope_value_to_scope_name_mapping keeps the raw stored values as keys.
Source code in components/fr/internal/operational_scopes/business_logic/queries.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="Liste des certificats de naissance et d’adoption",
description="Liste des certificats de naissance et d'adoption reçues sur le contrat",
getter=_get_all_birth_or_adoption_certificates,
raw_type=list[BirthOrAdoptionCertificateInfo],
scope=CONTACTING_MEMBER,
formatter=_format_birth_and_adoption_certificates,
anonymize=_anonymize_birth_or_adoption_certificates,
)
date_block_reimbursements
module-attribute
¶
date_block_reimbursements = MemberAttributeDefinition[date](
name="date_block_reimbursements",
display_name="Date de blocage des remboursements",
description="Date à laquelle les remboursements seront ou ont été bloqués",
getter=_get_date_block_reimbursements,
raw_type=date,
scope=CONTACTING_MEMBER,
)
employee_costs
module-attribute
¶
employee_costs = MemberAttributeDefinition[
BeneficiaryPrice
](
name="employee_costs",
display_name="Prix de la cotisation par bénéficiaire",
description="Le prix de la cotisation Alan pour chaque membre (titulaire, conjoint ou enfant)",
getter=_get_employee_costs,
raw_type=BeneficiaryPrice,
scope=CONTACTING_MEMBER,
formatter=_format_employee_costs,
)
employee_costs_option
module-attribute
¶
employee_costs_option = MemberAttributeDefinition[
list[BeneficiaryPrice]
](
name="employee_costs_option",
display_name="Prix des options",
description="Le détail des tarifs de cotisations optionnelles pour chacun des bénéficiaires",
getter=_get_employee_costs_option,
raw_type=list[BeneficiaryPrice],
scope=CONTACTING_MEMBER,
formatter=_format_employee_costs_option,
)
most_recent_quote_document
module-attribute
¶
most_recent_quote_document = MemberAttributeDefinition[
QuoteDocumentInfo
](
name="most_recent_quote_document",
display_name="Devis le plus récent",
description="Indique les informations clés du dernier devis traité en date. Cet attribut donne des informations sur le devis, la date de téléchargement, le statut, la raison du rejet, le contenu traité par nos équipes, et l'estimation qui en résulte.",
getter=_get_most_recent_quote_document,
raw_type=QuoteDocumentInfo,
scope=CONTACTING_MEMBER,
)
policy_id
module-attribute
¶
policy_id = MemberAttributeDefinition[int](
name="policy_id",
display_name="Numéro d'identification de la couverture santé",
description="Indique le numéro d'identification de la couverture santé désirée",
getter=_get_policy_id,
raw_type=int,
scope=CONTACTING_MEMBER,
)
policy_status
module-attribute
¶
policy_status = MemberAttributeDefinition[PolicyStatus](
name="policy_status",
display_name="Statut actuel de la couverture",
description="Indique le statut actuel de la couverture santé du membre",
getter=_get_policy_status,
raw_type=PolicyStatus,
scope=CONTACTING_MEMBER,
formatter=_format_policy_status,
)
policy_termination_type
module-attribute
¶
policy_termination_type = MemberAttributeDefinition[
EmployeeTerminationType
](
name="policy_termination_type",
display_name="Raison de rupture du contrat de travail précédent",
description="Indique le motif de rupture du précédent contrat, et par la même occasion l'éligibilité à la portabilité",
getter=_get_policy_termination_type,
raw_type=EmployeeTerminationType,
scope=CONTACTING_MEMBER,
formatter=_format_policy_termination_type,
)
recent_quote_documents
module-attribute
¶
recent_quote_documents = MemberAttributeDefinition[
list[QuoteDocumentInfo]
](
name="recent_quote_documents",
display_name="Historique des devis récents",
description="Liste des derniers devis envoyés au membre",
getter=_get_recent_quote_documents,
raw_type=list[QuoteDocumentInfo],
scope=CONTACTING_MEMBER,
)
reimbursement_block_reason
module-attribute
¶
reimbursement_block_reason = MemberAttributeDefinition[
BlockReimbursementsReason
](
name="reimbursement_block_reason",
display_name="Raison des remboursements bloqués",
description="Fournit les raisons possibles du blocage des remboursements du membre",
getter=_get_reimbursement_block_reason,
raw_type=BlockReimbursementsReason,
scope=CONTACTING_MEMBER,
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 ¶
actions ¶
HandcraftedSpecGroupCollisionError ¶
Bases: Exception
Raised when a catalog-generated name collides with a hand-crafted group.
create_prevoyance_guarantee_spec_from_catalog ¶
create_prevoyance_guarantee_spec_from_catalog(
*,
name,
title,
sub_title,
templated_claim,
templated_sub_claim,
templated_description,
eligibility_criteria_array,
constant_value_coverage_parameter_set,
group_id,
save=True
)
Create a new PrevoyanceGuaranteeSpec generated from the guarantee catalog.
Always sets generated_from_guarantee_catalog=True. The check constraint
on the table requires constant_value_coverage_parameter_set to be
non-null for catalog-generated specs, so it's a required arg here.
Source code in components/fr/public/prevoyance/actions.py
delete_prevoyance_builder_guarantees_referencing_catalog_specs ¶
Delete every PrevoyanceBuilderGuarantee whose spec is catalog-generated.
Used to free FK references before bulk-deleting catalog-generated specs. Destructive — only use in --clear / reset flows where wiping linked builder_guarantees is the intent. Returns the rowcount.
Source code in components/fr/public/prevoyance/actions.py
delete_prevoyance_guarantee_spec_groups_from_catalog ¶
Delete every PrevoyanceGuaranteeSpecGroup with generated_from_guarantee_catalog=True.
FK constraints from PrevoyanceGuaranteeSpec.group_id will block if any spec still references a deleted group — callers must delete catalog- generated specs first.
Source code in components/fr/public/prevoyance/actions.py
delete_prevoyance_guarantee_specs_from_catalog ¶
Delete every PrevoyanceGuaranteeSpec with generated_from_guarantee_catalog=True.
Returns the rowcount. Will raise an FK violation if any deleted row is still referenced by a PrevoyanceGuarantee / PrevoyanceBuilderGuarantee — that's a useful signal that the spec is in use, not a bug to swallow.
Source code in components/fr/public/prevoyance/actions.py
upsert_prevoyance_guarantee_spec_group_from_catalog ¶
upsert_prevoyance_guarantee_spec_group_from_catalog(
*, name, title, sub_title, cg_part, save=True
)
Upsert a PrevoyanceGuaranteeSpecGroup by name; mark as catalog-generated.
If a row with the same name exists and is NOT catalog-generated, refuses to touch it — we never override hand-crafted groups (per stack design).
Source code in components/fr/public/prevoyance/actions.py
entities ¶
InternalizedPermanentDisabilityCategory ¶
Bases: AlanBaseEnum
Permanent disability category as defined by the secu https://www.service-public.fr/particuliers/vosdroits/F672 ⧉ > Montant
- Category 1: Disability able to have a paid job
- Category 2: Disability not able to have any work
- Category 3: Disability not able to have any work and which needs an assistance for daily actions
This would change the coverage computation applied to the disability
InternalizedPrevoyanceEventType ¶
Bases: AlanBaseEnum
from_prevoyance_event_class
staticmethod
¶
Source code in components/fr/internal/prevoyance_claim_management/enums/internalized_prevoyance_event_type.py
permanent_disability
class-attribute
instance-attribute
¶
InternalizedPrevoyanceRelationshipType ¶
Bases: AlanBaseEnum
This enum lists all the type of relationship a prevoyance beneficiary can have with the insured member (including be themselves).
This is not the relationship to the event user! So if a partner dies, the beneficiary (the member themselves), should have a relationship type of "self", not "partner".
This can evolve depending on the guarantees and the type of claim we will support
declared_in_beneficiary_clause
class-attribute
instance-attribute
¶
InternalizedWorkStoppageReason ¶
Bases: AlanBaseEnum
DEPRECATED_parental_leave
class-attribute
instance-attribute
¶
accident_caused_by_third_party
class-attribute
instance-attribute
¶
accident_not_caused_by_third_party
class-attribute
instance-attribute
¶
professional_accident
class-attribute
instance-attribute
¶
professional_accident_with_aggression
class-attribute
instance-attribute
¶
professional_disease
class-attribute
instance-attribute
¶
spa_covered_by_secu
class-attribute
instance-attribute
¶
PrevoyanceCgPart ¶
Bases: AlanBaseEnum
This enum is used to identify the different categories of prevoyance guarantees. The name cg_part is a legacy name from when we used to have prevoyance externalised, and those categories were used only in the CG (condition generales) to describe the prevoyance guarantees.
Today those values determine how we compute the coverage of the prevoyance guarantees.
capital_deces_PTIA_accidentels
class-attribute
instance-attribute
¶
capital_deces_ascendant
class-attribute
instance-attribute
¶
capital_deces_conjoint
class-attribute
instance-attribute
¶
capital_deces_enfant
class-attribute
instance-attribute
¶
invalidite_permanente
class-attribute
instance-attribute
¶
majoration_capital_deces
class-attribute
instance-attribute
¶
majoration_for_partner_death
class-attribute
instance-attribute
¶
PrevoyanceGuaranteeAgeAtDeathCoverageFactor ¶
Bases: AlanBaseEnum
This enum defines the coverage factor for the age at death This factor is used to compute the amount: basis x quantity x coverage_factor
PrevoyanceGuaranteeBasis ¶
Bases: AlanBaseEnum
PASS_invalidity_rate
class-attribute
instance-attribute
¶
SAR_per_dependent_child
class-attribute
instance-attribute
¶
SNR_invalidity_rate
class-attribute
instance-attribute
¶
death_lump_sum_and_increase
class-attribute
instance-attribute
¶
death_lump_sum_inc_accident
class-attribute
instance-attribute
¶
death_lump_sum_non_accidental
class-attribute
instance-attribute
¶
PrevoyanceGuaranteeConstantValueCoverageParameterSet
dataclass
¶
PrevoyanceGuaranteeConstantValueCoverageParameterSet(
basis=None,
quantity=None,
basis_for_min=None,
quantity_for_min=None,
basis_for_max=None,
quantity_for_max=None,
secu_amount_included=None,
coverage_max_limit_amount=None,
coverage_max_duration_years=None,
coverage_max_duration_days=None,
coverage_max_covered_days=None,
deductible_type=None,
deductible=None,
atmp_reduced_deductible=None,
hospitalisation_reduced_deductible=None,
one_year_reduced_deductible=None,
new_parent_leave_reduced_deductible=None,
treatment_maintien_salaire=None,
use_death_lump_sum_beneficiaries=None,
split_total_claim_amount_equally=None,
doubled_if_orphan=None,
age_at_death_coverage_factor=None,
rente_conjoint_duration_type=None,
)
Bases: PrevoyanceGuaranteeCoverageParameterSet
Coverage parameter set populated only from catalog constant-source params.
Same fields as PrevoyanceGuaranteeCoverageParameterSet (inherited), but
basis and quantity are optional — the catalog often leaves them
user-source on the offer rather than pinning them at the spec level.
Persisted on PrevoyanceGuaranteeSpec.constant_value_coverage_parameter_set.
PrevoyanceGuaranteeCoverageLimit ¶
PrevoyanceGuaranteeCoverageParameterSet
dataclass
¶
PrevoyanceGuaranteeCoverageParameterSet(
basis,
quantity,
basis_for_min=None,
quantity_for_min=None,
basis_for_max=None,
quantity_for_max=None,
secu_amount_included=None,
coverage_max_limit_amount=None,
coverage_max_duration_years=None,
coverage_max_duration_days=None,
coverage_max_covered_days=None,
deductible_type=None,
deductible=None,
atmp_reduced_deductible=None,
hospitalisation_reduced_deductible=None,
one_year_reduced_deductible=None,
new_parent_leave_reduced_deductible=None,
treatment_maintien_salaire=None,
use_death_lump_sum_beneficiaries=None,
split_total_claim_amount_equally=None,
doubled_if_orphan=None,
age_at_death_coverage_factor=None,
rente_conjoint_duration_type=None,
)
Bases: DataClassJsonMixin
This coverage parameter set will determine how to compute covered amount for each guarantee
There are different set of parameters: - Quantitative rules: quantity, basis (eg 80% of brut reference salary) - Limits: quantity/basis for min/max, max amounts, max duration - Deductible: useful for work stoppages, these could be reduced in some circumstances (eg ATMP, Hospitalisation) - Specific rules: how to treat secu, maintien de salaire, double effect case
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 ⧉ TODO: migrate existing values in the guarantee and use this JSON dataclass
age_at_death_coverage_factor
class-attribute
instance-attribute
¶
hospitalisation_reduced_deductible
class-attribute
instance-attribute
¶
new_parent_leave_reduced_deductible
class-attribute
instance-attribute
¶
rente_conjoint_duration_type
class-attribute
instance-attribute
¶
split_total_claim_amount_equally
class-attribute
instance-attribute
¶
use_death_lump_sum_beneficiaries
class-attribute
instance-attribute
¶
PrevoyanceGuaranteeDeductibleType ¶
Bases: AlanBaseEnum
This enum defines how to compute deductible: there could be different way to count deductible period (eg continuous / discontinuous)
discontinuous_over_12_months
class-attribute
instance-attribute
¶
PrevoyanceGuaranteeRenteConjointDurationType ¶
Bases: AlanBaseEnum
This indicates the duration of the rente conjoint. A rente can be either temporary or permanent: - Temporary (fixed duration): the rente is paid for a limited duration, typically 5 years - Temporary (until retirement) like "Jusqu'à la liquidation de la pension vieillesse du conjoint bénéficiaire" - Permanent (viagère): the rente is paid for the entire duration of the contract
PrevoyanceGuaranteeSecuAmountIncluded ¶
Bases: AlanBaseEnum
This enums defines which secu amount to include in the coverage computation. Options are: brut, net or not included
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_dependent_at_simultaneous_partner_death=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)
is_dependent_at_simultaneous_partner_death
class-attribute
instance-attribute
¶
is_under_supervision_or_in_psychiatric_hospital
class-attribute
instance-attribute
¶
max_age_at_disability_start_date
class-attribute
instance-attribute
¶
unemployed_without_benefits_max_covered_age
class-attribute
instance-attribute
¶
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
PrevoyanceGuaranteeTreatmentMaintienSalaire ¶
Bases: AlanBaseEnum
This enum defines how to deal with maintien de salaire. Options are coverage are: - In complement: we only complement maintien de salaire - In relay: we only cover when the maintien de salaire is over - In complement and relay: we cover based on our parameters even if there is maintien de salaire
categories_for_cg_parts
module-attribute
¶
categories_for_cg_parts = {
majoration_capital_deces: "death",
capital_deces_PTIA: "death",
capital_deces_PTIA_accidentels: "death",
capital_deces_conjoint: "death",
capital_deces_enfant: "death",
capital_deces_ascendant: "death",
rente_education: "death",
rente_conjoint: "death",
double_effet: "death",
frais_obseques: "death",
invalidite_permanente: "permanent_disability",
incapacite_totale: "temporary_disability",
revalorisation: "claim_revaluation",
majoration_for_partner_death: "death",
}
labels ¶
French labels for prévoyance event types and work-stoppage reasons.
Shared by the prévoyance member-attribute formatters (and the PREV-3600 retrieve-claim tool). Work-stoppage status is intentionally left as the raw technical value: the agent playbook maps each status to its resolution, which the coarser member-facing wording can't convey.
PREVOYANCE_DOCUMENT_TYPE_LABELS
module-attribute
¶
PREVOYANCE_DOCUMENT_TYPE_LABELS = {
work_stoppage_justification_document: "Justificatif d'arrêt de travail (volet 3, bulletin de situation)",
identity_document: "Pièce d'identité",
payslip: "Bulletin de salaire",
medical_document: "Document médical",
proof_of_relapse: "Justificatif de rechute",
proof_of_long_term_condition: "Justificatif d'affection longue durée (ALD)",
ijss_attestation: "Attestation de paiement des IJSS",
maintien_de_salaire_proof: "Justificatif de maintien de salaire",
therapeutic_part_time_salary: "Bulletin de salaire en temps partiel thérapeutique",
sworn_statement: "Attestation sur l'honneur",
tax_statement: "Avis d'imposition",
}
PREVOYANCE_EVENT_TYPE_LABELS
module-attribute
¶
PREVOYANCE_EVENT_TYPE_LABELS = {
work_stoppage: "Arrêt de travail",
permanent_disability: "Invalidité",
death: "Décès",
}
SUBROGATION_PAYMENT_RECIPIENT_LABELS
module-attribute
¶
SUBROGATION_STATUS_LABELS
module-attribute
¶
SUBROGATION_STATUS_LABELS = {
full_subrogation: "Subrogation totale",
partial_subrogation: "Subrogation partielle",
no_subrogation: "Pas de subrogation",
}
WORK_STOPPAGE_REASON_LABELS
module-attribute
¶
WORK_STOPPAGE_REASON_LABELS = {
disease: "Maladie",
professional_disease: "Maladie professionnelle",
professional_accident: "Accident de travail ou de trajet",
professional_accident_with_aggression: "Accident de travail avec agression",
accident_caused_by_third_party: "Accident causé par un tiers",
accident_not_caused_by_third_party: "Accident sans tiers responsable",
maternity_leave: "Congé maternité",
paternity_leave: "Congé paternité",
adoption_leave: "Congé d'adoption",
spa_covered_by_secu: "Cure thermale acceptée par la Sécurité Sociale",
child_death: "Décès d'un enfant",
DEPRECATED_parental_leave: "Congé parental",
}
member_attributes ¶
MemberAttributePrevoyanceCoverageEndInfo
dataclass
¶
MemberAttributePrevoyanceCoverageStartInfo
dataclass
¶
PrevoyanceContractInfo
dataclass
¶
PrevoyanceContractInfo(
status,
company_name,
start_date=isodate_field(),
end_date=optional_isodate_field(default=None),
populations=None,
)
Bases: DataClassJsonMixin
Active/upcoming prevoyance contract as exposed to member-attribute consumers.
PrevoyanceContractStatus ¶
Bases: AlanBaseEnum
Lifecycle status of a prevoyance contract relative to a reference date.
admin_companies_prevoyance_contracts
module-attribute
¶
admin_companies_prevoyance_contracts = MemberAttributeDefinition[
list[PrevoyanceContractInfo]
](
name="admin_companies_prevoyance_contracts",
display_name="Contrats de prevoyance de l'entreprise",
description="Indique tous les contrats de prevoyance actifs pour une entreprise donnée, et leurs statuts",
getter=_get_admin_companies_prevoyance_contracts,
raw_type=list[PrevoyanceContractInfo],
formatter=format_prevoyance_contracts,
scope=CONTACTING_MEMBER,
)
build_prevoyance_contract_infos ¶
Build PrevoyanceContractInfo list from a company's prevoyance contracts.
Only includes active and upcoming contracts.
Source code in components/fr/public/prevoyance/member_attributes.py
continuous_prevoyance_coverage_end_date
module-attribute
¶
continuous_prevoyance_coverage_end_date = MemberAttributeDefinition[
list[MemberAttributePrevoyanceCoverageEndInfo]
](
name="continuous_prevoyance_coverage_end_date",
display_name="Date jusqu'à laquelle le membre est couvert en prévoyance (par entreprise)",
description="Pour chaque entreprise couvrant le membre titulaire, la date jusqu'à laquelle il est couvert en continu par un contrat de prévoyance. Vide pour une couverture en cours (sans date de fin). Plusieurs entrées possibles si le membre a des emplois concurrents (ex. temps partiel).",
getter=_get_continuous_prevoyance_coverage_ends,
raw_type=list[MemberAttributePrevoyanceCoverageEndInfo],
formatter=format_prevoyance_coverage_ends,
scope=CONTACTING_MEMBER,
)
continuous_prevoyance_coverage_start_date
module-attribute
¶
continuous_prevoyance_coverage_start_date = MemberAttributeDefinition[
list[MemberAttributePrevoyanceCoverageStartInfo]
](
name="continuous_prevoyance_coverage_start_date",
display_name="Date depuis laquelle le membre est couvert en prévoyance (par entreprise)",
description="Pour chaque entreprise couvrant le membre titulaire, la date depuis laquelle il est couvert en continu par un contrat de prévoyance. Plusieurs entrées possibles si le membre a des emplois concurrents (ex. temps partiel).",
getter=_get_continuous_prevoyance_coverage_starts,
raw_type=list[
MemberAttributePrevoyanceCoverageStartInfo
],
formatter=format_prevoyance_coverage_starts,
scope=CONTACTING_MEMBER,
)
format_prevoyance_contracts ¶
Format prevoyance contracts for display in the support AI prompt.
Source code in components/fr/public/prevoyance/member_attributes.py
format_prevoyance_coverage_ends ¶
Format per-company continuous coverage ends for the support AI prompt.
Source code in components/fr/public/prevoyance/member_attributes.py
format_prevoyance_coverage_starts ¶
Format per-company continuous coverage starts for the support AI prompt.
Source code in components/fr/public/prevoyance/member_attributes.py
format_prevoyance_events ¶
Format the member's prévoyance events for the support AI prompt.
Source code in components/fr/public/prevoyance/member_attributes.py
format_relapse_work_stoppages ¶
Format the member's relapse work stoppages for the support AI prompt.
One line per relapse work stoppage.
Source code in components/fr/public/prevoyance/member_attributes.py
format_work_stoppage_details ¶
Format the member's work-stoppage details for the support AI prompt.
Example line: "Arrêt de travail du [2024-02-01 (...)] au [2024-03-01 (...)] — motif : [Maladie] — garanties : [Mensualisation, IJSS]".
Source code in components/fr/public/prevoyance/member_attributes.py
format_work_stoppage_first_covered_days ¶
Format the member's first-covered-day-after-deductible for the support AI prompt.
One line per work stoppage that has started being covered.
Source code in components/fr/public/prevoyance/member_attributes.py
format_work_stoppage_missing_documents ¶
Format the member's missing work-stoppage documents for the support AI prompt.
One line per work stoppage with at least one missing document. Document types without a French label fall back to their raw technical value.
Source code in components/fr/public/prevoyance/member_attributes.py
format_work_stoppage_missing_maintien_de_salaire_periods ¶
format_work_stoppage_missing_maintien_de_salaire_periods(
missing_periods_per_work_stoppage, on_date
)
Format the member's missing maintien-de-salaire months for the support AI prompt.
One line per work stoppage with at least one missing month; months are rendered as French month-year (e.g. "Novembre 2024").
Source code in components/fr/public/prevoyance/member_attributes.py
format_work_stoppage_subrogations ¶
Format the member's work-stoppage subrogation for the support AI prompt.
One line per work stoppage: the overall status plus the timeline of who Alan pays over each period.
Source code in components/fr/public/prevoyance/member_attributes.py
member_prevoyance_events
module-attribute
¶
member_prevoyance_events = MemberAttributeDefinition[
list[MemberAttributePrevoyanceEvent]
](
name="member_prevoyance_events",
display_name="Événements de prévoyance du membre (type et statut)",
description="Liste des événements de prévoyance du membre titulaire (arrêt de travail, invalidité, décès) avec leur type, leur date de début, et — pour les arrêts de travail — leur statut courant (celui affiché sur le dashboard membre). Aide à identifier le dossier dont parle le membre.",
getter=_get_member_prevoyance_events,
raw_type=list[MemberAttributePrevoyanceEvent],
formatter=format_prevoyance_events,
scope=CONTACTING_MEMBER,
)
member_relapse_work_stoppages
module-attribute
¶
member_relapse_work_stoppages = MemberAttributeDefinition[
list[MemberAttributeWorkStoppageRelapse]
](
name="member_relapse_work_stoppages",
display_name="Arrêts de travail du membre qui sont des rechutes",
description="Liste des arrêts de travail du membre titulaire qui sont des rechutes (prolongations d'un arrêt antérieur). Les arrêts qui ne sont pas des rechutes ne sont pas listés ; chaque rechute est repérée par sa date de début d'arrêt, à recouper avec les détails et événements de prévoyance.",
getter=_get_member_relapse_work_stoppages,
raw_type=list[MemberAttributeWorkStoppageRelapse],
formatter=format_relapse_work_stoppages,
scope=CONTACTING_MEMBER,
)
member_work_stoppage_details
module-attribute
¶
member_work_stoppage_details = MemberAttributeDefinition[
list[MemberAttributeWorkStoppageDetails]
](
name="member_work_stoppage_details",
display_name="Détails des arrêts de travail du membre (dates, motif, garanties)",
description="Liste des arrêts de travail du membre titulaire avec, pour chacun, ses dates de début et de fin, son motif, les garanties de prévoyance des dossiers en cours, le salaire brut de référence annuel, la date de début du contrat de travail, et les périodes de temps partiel thérapeutique. À utiliser une fois le dossier identifié ; pour les arrêts de travail présents aussi dans les événements de prévoyance, l'id est le même.",
getter=_get_member_work_stoppage_details,
raw_type=list[MemberAttributeWorkStoppageDetails],
formatter=format_work_stoppage_details,
scope=CONTACTING_MEMBER,
)
member_work_stoppage_first_covered_days
module-attribute
¶
member_work_stoppage_first_covered_days = MemberAttributeDefinition[
list[MemberAttributeWorkStoppageFirstCoveredDay]
](
name="member_work_stoppage_first_covered_days",
display_name="Premier jour couvert après franchise par arrêt de travail",
description="Pour chaque arrêt de travail du membre titulaire ayant commencé à être couvert, le premier jour couvert après la franchise (le jour le plus précoce où une garantie commence à indemniser ; les garanties peuvent avoir des franchises différentes). L'id de l'arrêt est le même que dans les détails et événements de prévoyance pour les corréler.",
getter=_get_member_work_stoppage_first_covered_days,
raw_type=list[
MemberAttributeWorkStoppageFirstCoveredDay
],
formatter=format_work_stoppage_first_covered_days,
scope=CONTACTING_MEMBER,
)
member_work_stoppage_missing_documents
module-attribute
¶
member_work_stoppage_missing_documents = MemberAttributeDefinition[
list[MemberAttributeWorkStoppageMissingDocuments]
](
name="member_work_stoppage_missing_documents",
display_name="Documents manquants sur les arrêts de travail du membre",
description="Pour chaque arrêt de travail du membre titulaire encore en attente de pièces, la liste des documents manquants côté membre (jusqu'à la date de fin de l'arrêt). Les arrêts sans document manquant ne sont pas listés ; l'id de l'arrêt est le même que dans les détails et événements de prévoyance pour les corréler.",
getter=_get_member_work_stoppage_missing_documents,
raw_type=list[
MemberAttributeWorkStoppageMissingDocuments
],
formatter=format_work_stoppage_missing_documents,
scope=CONTACTING_MEMBER,
)
member_work_stoppage_missing_maintien_de_salaire_periods
module-attribute
¶
member_work_stoppage_missing_maintien_de_salaire_periods = MemberAttributeDefinition[
list[
MemberAttributeWorkStoppageMissingMaintienDeSalairePeriods
]
](
name="member_work_stoppage_missing_maintien_de_salaire_periods",
display_name="Mois de maintien de salaire manquant par arrêt de travail",
description="Pour chaque arrêt de travail du membre titulaire, les mois pour lesquels la déclaration de maintien de salaire de l'employeur manque encore (vision membre). Les arrêts sans mois manquant ne sont pas listés ; l'id de l'arrêt est le même que dans les détails et événements de prévoyance pour les corréler. Souvent vide tant que la fonctionnalité « périodes de maintien de salaire » n'est pas activée pour l'arrêt.",
getter=_get_member_work_stoppage_missing_maintien_de_salaire_periods,
raw_type=list[
MemberAttributeWorkStoppageMissingMaintienDeSalairePeriods
],
formatter=format_work_stoppage_missing_maintien_de_salaire_periods,
scope=CONTACTING_MEMBER,
)
member_work_stoppage_subrogations
module-attribute
¶
member_work_stoppage_subrogations = MemberAttributeDefinition[
list[MemberAttributeWorkStoppageSubrogation]
](
name="member_work_stoppage_subrogations",
display_name="Statut de subrogation des arrêts de travail du membre",
description="Pour chaque arrêt de travail du membre titulaire, son statut de subrogation (totale, partielle ou aucune) et le détail des versements période par période (à qui Alan verse les indemnités : à l'employeur ou au membre). La subrogation totale signifie qu'Alan verse les indemnités à l'employeur. Chaque arrêt est repéré par sa date de début, à recouper avec les détails et événements de prévoyance.",
getter=_get_member_work_stoppage_subrogations,
raw_type=list[MemberAttributeWorkStoppageSubrogation],
formatter=format_work_stoppage_subrogations,
scope=CONTACTING_MEMBER,
)
primary_user_company_prevoyance_contracts
module-attribute
¶
primary_user_company_prevoyance_contracts = MemberAttributeDefinition[
list[PrevoyanceContractInfo]
](
name="primary_user_company_prevoyance_contracts",
display_name="Contrat(s) de prévoyance liés à l'entreprise du membre titulaire",
description="Décrit si l'entreprise (citée au début) du membre titulaire a un contrat de Prévoyance actif, et si il y en a un, pour quelle catégorie socio-professionnelle (cadre, non-cadre, ou les deux)",
getter=_get_primary_user_company_prevoyance_contracts,
raw_type=list[PrevoyanceContractInfo],
formatter=format_prevoyance_contracts,
scope=CONTACTING_MEMBER,
)
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
list_prevoyance_guarantee_spec_names ¶
Return the set of existing PrevoyanceGuaranteeSpec.name values.
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.sirene ¶
company ¶
Public access to INSEE SIRENE establishment data, with DSN fallback.
get_sirene_establishment_from_siret ¶
Fetch the establishment matching the given full SIRET.
Tries INSEE SIRENE first via get_sirene_establishments_for_company (which
itself falls back to DSN when INSEE is unavailable). If INSEE responds but
doesn't know this specific SIRET, fall back to DSN directly so callers don't
regress vs the legacy DSN-only behavior — partial address (postal+city, no
street) is preferable to a blank row.
Source code in components/fr/public/sirene/company.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="Peut demander une carte physique TP",
description="Indique si le membre peut faire une demande de carte de tiers-payant physique",
getter=_get_can_request_physical_tp_card,
raw_type=bool,
scope=BENEFICIARY,
)
date_physical_tp_card_shipped
module-attribute
¶
date_physical_tp_card_shipped = MemberAttributeDefinition[
date
](
name="date_physical_tp_card_shipped",
display_name="Date d’envoi de la carte physique TP",
description="Indique la date à laquelle la carte de tiers-payant a été expédiée",
getter=_get_date_physical_tp_card_shipped,
raw_type=date,
scope=BENEFICIARY,
)
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="Le membre a opté pour le statut digital uniquement",
description="Indique si le membre a opté pour une carte de tiers-payant virtuelle uniquement",
getter=_get_did_opt_out_physical_tp_card,
raw_type=bool,
scope=BENEFICIARY,
)
tp_card_contract_scheme
module-attribute
¶
tp_card_contract_scheme = MemberAttributeDefinition[
TpCardScheme
](
name="tp_card_contract_scheme",
display_name="Type de carte Alan (entreprise)",
description="Indique quel type de carte Alan par défaut l'entreprise a choisi pour ses employés (virtuelle ou physique)",
getter=_get_tp_card_contract_scheme,
raw_type=TpCardScheme,
scope=BENEFICIARY,
)
tp_card_scheme
module-attribute
¶
tp_card_scheme = MemberAttributeDefinition[TpCardScheme](
name="tp_card_scheme",
display_name="Type de carte Alan (membre)",
description="Indique quel type de carte Alan par défaut le membre a choisi pour lui-même (virtuelle ou physique)",
getter=_get_tp_card_scheme,
raw_type=TpCardScheme,
scope=BENEFICIARY,
)
tp_card_scheme_reason
module-attribute
¶
tp_card_scheme_reason = MemberAttributeDefinition[
InsuranceProfileTpCardSchemeReason
](
name="tp_card_scheme_reason",
display_name="Raison pour le type de carte Alan",
description="Indique la raison pour laquelle ce type de carte Alan est activé",
getter=_get_tp_card_scheme_reason,
raw_type=InsuranceProfileTpCardSchemeReason,
scope=BENEFICIARY,
)
tp_card_status
module-attribute
¶
tp_card_status = MemberAttributeDefinition[TpCardStatus](
name="tp_card_status",
display_name="Statut de la carte de tiers-payant",
description="Statut de la carte de tiers-payant : à vérifier pour toute demande concernant une commande ou un envoi de carte de tiers-payant",
getter=_get_tp_card_status,
raw_type=TpCardStatus,
scope=BENEFICIARY,
)
tp_rights_activated
module-attribute
¶
tp_rights_activated = MemberAttributeDefinition[bool](
name="tp_rights_activated",
display_name="Droit de tiers-payant activé",
description="Indique si les droits de tiers-payant sont activés",
getter=_get_tp_rights_activated,
raw_type=bool,
scope=BENEFICIARY,
)
tp_rights_referent
module-attribute
¶
tp_rights_referent = MemberAttributeDefinition[str](
name="tp_rights_referent",
display_name="Nom du référent Tiers-payant",
description="Personne désignée pour la gestion du tiers-payant de l’enfant",
getter=_get_tp_rights_referent,
raw_type=str,
scope=BENEFICIARY,
anonymize=anonymize_full_name,
)
tp_rights_status
module-attribute
¶
tp_rights_status = MemberAttributeDefinition[
TpRightsStatus
](
name="tp_rights_status",
display_name="Statut de droits tiers-payant",
description="Indique le statut actuel des droits de tiers-payant du membre",
getter=_get_tp_rights_status,
raw_type=TpRightsStatus,
scope=BENEFICIARY,
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,
realm=RealmName.ALAN,
)
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
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 231 232 233 234 235 236 237 | |
create_or_link_user ¶
create_or_link_user(
*,
profile_service,
email=None,
first_name=None,
last_name=None,
birth_date=None,
language=None,
phone_number=None,
gender=None
)
Create a FR User -- linking to an existing Profile if one already matches the given email, creating a fresh Profile otherwise.
Use when the caller doesn't care whether the person is brand-new or
already has a Profile from another country / a prior invite (e.g. admin
onboarding flows). Callers that need to fail on an existing Profile
should keep using create_profile_with_user directly.
Source code in components/fr/public/user/create_profile_with_user.py
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
create_user_for_existing_profile ¶
Create a FR User for an existing global Profile and link them.
Use when a Profile already exists (e.g. the person has a User in another country, or only a bare profile from an admin invite) but no FR User is attached yet. Mirrors the Profile's identity/demographic fields onto the new User, links the Keycloak identity if any, and registers the link in global_profile.
Does NOT create or modify Keycloak credentials -- if the existing Profile has no Keycloak identity, the resulting User won't be able to log in until credentials are set through a separate flow.
Source code in components/fr/public/user/create_profile_with_user.py
global_user_id ¶
Resolve an FR-local user id to its true global_user_id.
to_global_user_id ¶
Resolve a local FR user id to its global_user_id.
FR analogue of ES to_global_user_id. ProfileService is the
public-safe accessor that core_enrollment's UserIdMapping wraps; using
it directly keeps this public module free of cross-component internals.
Source code in components/fr/public/user/global_user_id.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 ¶
UserStateCategory ¶
UserStateToDisplay
dataclass
¶
UserStates ¶
Bases: AlanBaseEnum
Concrete user state values surfaced in member attributes.
has_civil_servant_exemption_justification
module-attribute
¶
has_civil_servant_exemption_justification = MemberAttributeDefinition[
bool
](
name="has_civil_servant_exemption_justification",
display_name="Has civil servant exemption justification",
description="",
getter=_get_has_civil_servant_exemption_justification,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
has_prevoyance_work_stoppages
module-attribute
¶
has_prevoyance_work_stoppages = MemberAttributeDefinition[
bool
](
name="has_prevoyance_work_stoppages",
display_name="Le membre a des arrêts de travail en prévoyance",
description="Décrit s’il existe actuellement un arrêt de travail déclaré pour ce membre.",
getter=_get_has_prevoyance_work_stoppages,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
has_unpaid_leave_mandatory_coverage
module-attribute
¶
has_unpaid_leave_mandatory_coverage = (
MemberAttributeDefinition[bool](
name="has_unpaid_leave_mandatory_coverage",
display_name="has unpaid leave mandatory coverage",
description="",
getter=_get_has_unpaid_leave_mandatory_coverage,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
)
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 la facturation de l'option à l'employé aux données de paie",
description="Indiquer en paie que l'employé a souscrit à une option, afin que l'employeur puisse verser la compensation due",
getter=_get_include_option_billed_to_employee_in_payroll_data,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
is_civil_servant
module-attribute
¶
is_civil_servant = MemberAttributeDefinition[bool](
name="is_civil_servant",
display_name="Le membre est un agent d’un organisme public",
description="Le membre fait partie d'un organisme public",
getter=_get_is_civil_servant,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
is_disabled_ani_billing
module-attribute
¶
is_disabled_ani_billing = MemberAttributeDefinition[bool](
name="is_disabled_ani_billing",
display_name="ANI billing disabled",
description="",
getter=_get_is_disabled_ani_billing,
raw_type=bool,
scope=CONTACTING_MEMBER,
)
termination_letter_sent_at
module-attribute
¶
termination_letter_sent_at = MemberAttributeDefinition[
date
](
name="termination_letter_sent_at",
display_name="Lettre de résiliation envoyée le X date",
description="Date et heure d'envoi de la lettre de résiliation du membre",
getter=_get_termination_letter_sent_at,
raw_type=date,
scope=CONTACTING_MEMBER,
)
termination_letter_status
module-attribute
¶
termination_letter_status = MemberAttributeDefinition[
TerminationLetterStatus
](
name="termination_letter_status",
display_name="Statut de la lettre de résiliation",
description="Statut actuel de la lettre de résiliation du membre dans le processus d'envoi et d'accusé de réception",
getter=_get_termination_letter_status,
raw_type=TerminationLetterStatus,
scope=CONTACTING_MEMBER,
)
user_states
module-attribute
¶
user_states = MemberAttributeDefinition[
list[UserStateToDisplay]
](
name="user_states",
display_name="Statut actuel du membre contactant",
description="Indique l’état actuel du membre qui nous contacte (qui peut être un bénéficiaire ou le titulaire).",
getter=_get_user_states,
raw_type=list[UserStateToDisplay],
scope=CONTACTING_MEMBER,
formatter=_format_user_states_to_display,
)
primary_member_attributes ¶
primary_user_professional_category
module-attribute
¶
primary_user_professional_category = MemberAttributeDefinition[
ProfessionalCategory
](
name="primary_user_professional_category",
display_name="Catégorie socio-professionnelle du membre titulaire",
description='Si la valeur est "N/A" ou "None", cela veut dire que le membre n\'a pas de catégorie socio-professionelle spécifique.',
getter=_get_primary_user_professional_category,
raw_type=ProfessionalCategory,
scope=CONTACTING_MEMBER,
formatter=_format_professional_category,
)
primary_user_states
module-attribute
¶
primary_user_states = MemberAttributeDefinition[
list[UserStateToDisplay]
](
name="primary_user_states",
display_name="Statut actuel du membre titulaire",
description="Indique l’état actuel du membre principal (titulaire du contrat). Permet de récupérer des informations clés sur ce membre\u202f: s’il est couvert, son statut d’onboarding.",
getter=_get_primary_user_states,
raw_type=list[UserStateToDisplay],
scope=CONTACTING_MEMBER,
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.