Api reference
components.offer_builder.public.api ¶
OfferBuilderCreationCommand
module-attribute
¶
OfferBuilderCreationCommand = (
CreateBuilderProductFromProductChangeCommand
| DuplicateBuilderProductCommand
| CreateBuilderProductFromTemplateCommand
| CreateBuilderProductFromLiveProductCommand
| CreateBuilderProductSelfAmendmentAlternativesCommand
)
get_builder_templates_for_account ¶
Get builder templates for an account
Source code in components/offer_builder/public/api.py
get_many_builder_products ¶
Get many builder products by id
Source code in components/offer_builder/public/api.py
handle_create_builder_product_self_amendment_alternatives ¶
Handle the creation of a renewal alternatives builder product.
Source code in components/offer_builder/public/api.py
handle_create_manual_demographics_command ¶
Handles the command to create manual demographics.
Source code in components/offer_builder/public/api.py
handle_offer_builder_command ¶
Handle a command from the offer builder component.
Source code in components/offer_builder/public/api.py
handle_offer_builder_creation_command ¶
Create a builder product from a product change command.
Source code in components/offer_builder/public/api.py
handle_update_builder_products_after_prospect_update_command ¶
Handles the command to update products after prospect update.
Source code in components/offer_builder/public/api.py
search_builder_products ¶
search_builder_products(
builder_product_ids=None,
builder_scenario_ids=None,
prospect_refs=None,
account_refs=None,
origin=None,
tags=None,
is_frozen=None,
is_priced=None,
builder_product_max_age_in_days=None,
include_templates=False,
)
Search builder products by various filters.
Filtering conditions are: - "AND"ed together. - None by default: in this case, the condition is ignored in the search. - When they depend on the version, they are applied to the current_version (latest one).
Returns:
| Type | Description |
|---|---|
list[BuilderProduct]
|
List of builder products that match the filters. |
Source code in components/offer_builder/public/api.py
search_manual_demographics_for_prospect ¶
Search manual demographics for a prospect.
validate_proposal_readiness ¶
Checks that the builder product is ready to be used to create a proposal. If not an error is returned.
Currrently checks that: * product is priced * product doesn't have any blockers
Source code in components/offer_builder/public/api.py
components.offer_builder.public.commands ¶
create_builder_product_from_live_product_command ¶
CreateBuilderProductFromLiveProductCommand
dataclass
¶
CreateBuilderProductFromLiveProductCommand(
*,
account_id,
product_id,
tags,
origin,
builder_scenario_id=None,
creator_profile_id=None
)
Command to create a builder product from a live product.
Uses the sent account_id and product_id to fetch product changes and use the default one, with the default pricing strategy. See CreateBuilderProductFromProductChangeCommand for more details.
create_builder_product_from_product_change_command ¶
CreateBuilderProductFromProductChangeCommand
dataclass
¶
CreateBuilderProductFromProductChangeCommand(
*,
product_change_id,
tags,
origin,
pricing_strategy=ProductChangePricingStrategy.default_price_increase,
builder_scenario_id=None,
creator_profile_id=None
)
Command to create a builder product from a product change.
A ProductChange is a renewal concept, that includes: - An existing offer (ProductChange.product_id) to which an account is currently subscribed to and that we aim to renew - A set of new coverage_rules to use for the renewed offer - One or several pricing strategies to chose from
create_builder_product_from_template_command ¶
CreateBuilderProductFromTemplateCommand
dataclass
¶
CreateBuilderProductFromTemplateCommand(
*,
template_builder_product_id,
builder_entities,
origin,
tags,
price_structure=None,
builder_scenario_id=None,
creator_profile_id=None,
account_id,
target_population=None
)
Bases: DataClassJsonMixin
Command requesting to create a new BuilderProduct from a template
create_builder_product_self_amendment_alternatives_command ¶
CreateBuilderProductSelfAmendmentAlternativesCommand
dataclass
¶
CreateBuilderProductSelfAmendmentAlternativesCommand(
*,
reference_renewal_builder_product_id,
with_lower_premiumness,
with_higher_premiumness,
keep_reference_builder_product=True
)
Bases: DataClassJsonMixin
Command to create renewal alternatives for builder product based on a reference product.
keep_reference_builder_product
class-attribute
instance-attribute
¶
create_manual_demographics ¶
CreateManualDemographicsCommand
dataclass
¶
CreateManualDemographicsCommand(
*,
account_ref,
prospect_ref,
number_of_employees=None,
number_of_covered_employees=None,
average_age=None,
number_of_male=None,
number_of_cadre=None,
number_of_partners=None,
number_of_children=None,
number_of_first_children=None,
number_of_first_two_children=None,
number_of_single=None,
number_of_ani=None,
number_of_option_taker=None,
skip_update_builder_products=False,
country=None
)
Bases: DataClassJsonMixin
Command to create a manual demographics entry.
from_entity
classmethod
¶
Create a command from a ManualDemographics entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manual_demographics
|
ManualDemographics
|
The entity to convert from |
required |
account_ref
|
str | None
|
Account reference (required since it's not stored in the entity) |
required |
skip_update_builder_products
|
bool
|
Whether to skip updating builder products |
False
|
Returns:
| Type | Description |
|---|---|
Self
|
CreateManualDemographicsCommand instance |
Source code in components/offer_builder/public/commands/create_manual_demographics.py
number_of_first_two_children
class-attribute
instance-attribute
¶
skip_update_builder_products
class-attribute
instance-attribute
¶
to_entity ¶
Transforms the command to a ManualDemographics entity.
Source code in components/offer_builder/public/commands/create_manual_demographics.py
create_offer_from_builder_product_command ¶
CreateOfferFromBuilderProductCommand
dataclass
¶
Command requesting to create an offer from a BuilderProduct.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
builder_product_id
|
int
|
The ID of the BuilderProduct to create the offer from. |
required |
builder_product_version_id
|
int | None
|
Optional - The ID of the BuilderProductVersion to |
None
|
duplicate_builder_product_command ¶
DuplicateBuilderProductCommand
dataclass
¶
DuplicateBuilderProductCommand(
*,
builder_product_id,
builder_product_version_id=None,
creator_profile_id=None,
account_ref=NOT_SET,
target_population=NOT_SET,
builder_scenario_id=NOT_SET,
origin=NOT_SET,
tags=NOT_SET,
display_name=NOT_SET,
force_new_prospect_with_same_price=NOT_SET
)
Command requesting to duplicate a BuilderProduct
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
builder_product_id
|
int
|
The ID of the BuilderProduct to duplicate. |
required |
creator_profile_id
|
UUID | None
|
The profile ID of the creator of the duplicated product. |
None
|
force_new_prospect_with_same_price
class-attribute
instance-attribute
¶
update_builder_products_after_prospect_update_command ¶
UpdateBuilderProductsAfterProspectUpdateCommand
dataclass
¶
Bases: DataClassJsonMixin
Command requesting to update builder products after a prospect update.
When a prospect moves to another account, this command finds all builder products associated with the prospect and updates their account_ref if all targets are in the new account.
If not all prospects belong to the new account the product is not updated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prospect_ref
|
str
|
The ID of the prospect that was updated. |
required |
previous_alan_account_id
|
str
|
The previous account ID of the prospect (before update). |
required |
components.offer_builder.public.constants ¶
components.offer_builder.public.dependencies ¶
OfferBuilderDependency ¶
Bases: OfferBuilderPricerDependency, OfferBuilderManualDemographicsDependency, ABC, Generic[PriceTarget, PriceComponentType]
Abstract class defining the dependencies needed by the Offer Builder component.
create_amendment_builder_product
abstractmethod
¶
create_amendment_builder_product(
product_change_id,
product_type,
builder_scenario_id,
creator_profile_id,
)
Create an amendment builder product from the given command. This method should raise if the product type is not supported in the country.
Source code in components/offer_builder/public/dependencies.py
filter_builder_product_versions
abstractmethod
¶
Filters builder product version IDs based on the presence of associated plans.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
builder_product_version_ids
|
list[int]
|
A list of builder product version IDs to filter. |
required |
has_plan
|
bool
|
A flag indicating whether to return IDs with associated plans (True) or without (False). |
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
A list of filtered builder product version IDs. |
Source code in components/offer_builder/public/dependencies.py
get_all_products ¶
Retrieve all products for the given account (and optionally scenario). If this method needs to be overridden, it's recommended calling super().get_all_products() and returning those products along the additional local products to be handled in the Offer Builder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_ref
|
NotSet[str]
|
The identifier of the account to retrieve products for. |
NOT_SET
|
builder_scenario_ids
|
list[UUID | None] | None
|
The identifiers of the scenarios to retrieve products for. If the element is NOT_SET, returns all products, whatever the account. If None, returns the products not associated to any account. |
None
|
Source code in components/offer_builder/public/dependencies.py
get_builder_product_coverage_constraint_violations
abstractmethod
¶
Returns coverage constraint violations for all coverages of a given builder product
Source code in components/offer_builder/public/dependencies.py
get_builder_product_coverage_infos ¶
Returns coverage infos for all coverages of a given builder product
Source code in components/offer_builder/public/dependencies.py
get_builder_product_issues
abstractmethod
¶
Returns country specific issues for the given builder product
get_builder_product_min_participation ¶
Returns the minimum participation allowed for the given builder product
Source code in components/offer_builder/public/dependencies.py
get_competitor_products
abstractmethod
¶
Get the competitor product filtered on the given parameters.
Source code in components/offer_builder/public/dependencies.py
get_country_code
abstractmethod
¶
get_denoised_guarantee_coverage_validations ¶
Denoise coverage validations at guarantee level by removing redundancy and keeping the most constraining ones.
Source code in components/offer_builder/public/dependencies.py
get_eligibility_item_display_names
abstractmethod
¶
Returns the display names of the eligibility items.
get_offer_payload
abstractmethod
¶
Get the offer payload from the given builder_product.
get_plan_builder_product_and_version_for_company_on
abstractmethod
¶
Returns the builder product ID and version ID for the current active health insurance plan of the given company on the specified date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
company_ref
|
str
|
The string identifier of the company to look up |
required |
on_date
|
date
|
The date to check for active subscription |
required |
Returns:
| Type | Description |
|---|---|
tuple[int, int] | None
|
A tuple of (builder_product_id, builder_product_version_id) if an active plan is found, |
tuple[int, int] | None
|
None otherwise. |
Source code in components/offer_builder/public/dependencies.py
get_template_country_specific_filters ¶
Returns the filters to apply when retrieving builder templates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_ref
|
str
|
The account reference to get filters for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict[str, set[str]] | None
|
A dictionary of filter keys and their corresponding values to match against country_specific_data. |
|
dict[str, set[str]] | None
|
All templates matching one of the provided filters will be returned. |
|
dict[str, set[str]] | None
|
To disable filtering, return None (default behavior). |
|
Examples |
dict[str, set[str]] | None
|
|
Source code in components/offer_builder/public/dependencies.py
is_adding_coverage_allowed ¶
Check if a new coverage can be added to this product.
is_removing_coverage_allowed ¶
Check if a coverage can be removed from this product.
Source code in components/offer_builder/public/dependencies.py
list_product_changes ¶
Retrieve all product changes for the given account. If this method needs to be overridden, it's recommended calling super().list_product_changes() and returning those products along the additional local product changes to be handled in the Offer Builder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id
|
UUID
|
The identifier of the account to retrieve product changes for. |
required |
Source code in components/offer_builder/public/dependencies.py
make_coverage_list_for_template ¶
Returns a list of builder coverages from their definitions when creating a builder template.
Source code in components/offer_builder/public/dependencies.py
on_builder_scenario_deleted ¶
Called when a builder scenario is deleted (in a side effect so that the scenario is deleted even if this method raises an error).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
builder_scenario_id
|
UUID
|
The identifier of the builder scenario that was deleted. |
required |
Source code in components/offer_builder/public/dependencies.py
on_builder_scenario_duplicated ¶
Called when a builder scenario is duplicated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_builder_scenario_id
|
UUID
|
The identifier of the source builder scenario. |
required |
new_builder_scenario_id
|
UUID
|
The identifier of the new builder scenario. |
required |
Source code in components/offer_builder/public/dependencies.py
post_process_created_coverage ¶
Updates the coverage after being created. E.g., in Belgium we derive its price structure from its limits.
Source code in components/offer_builder/public/dependencies.py
post_process_product_created_from_template ¶
Post-process the builder product created from a template
update_coverage_country_specific_data ¶
Updates coverage country-specific data.
Source code in components/offer_builder/public/dependencies.py
validate_target_population
abstractmethod
¶
Should raise if target_population is not valid in the country
get_app_dependency ¶
Retrieve the Offer Builder dependency from the current app.
Source code in components/offer_builder/public/dependencies.py
set_app_dependency ¶
Set the Offer Builder dependency of the current app.
Source code in components/offer_builder/public/dependencies.py
components.offer_builder.public.entities ¶
builder_coverage ¶
BuilderCoverage
dataclass
¶
Bases: DataClassJsonMixin
Public BuilderCoverage entity
builder_coverage_rule ¶
BuilderCoverageDefinition
dataclass
¶
BuilderCoverageDefinition(
*,
selected_categories,
coverage_rules,
propagated_parameters,
aggregated_limit_parameters,
country_specific_data
)
Bases: DataClassJsonMixin
A coverage definition without configuration nor pricing.
get_coverage_rule ¶
BuilderCoverageRule
dataclass
¶
BuilderCoverageRule(
*,
id,
guarantee_ref,
bundle_choice_ref,
expression_type,
parameters,
eligibility_items_refs,
annual_cost_estimates=None
)
Bases: DataClassJsonMixin
A coverage rule with associated parameters, eligibility items and cost estimates
equals_ignoring_id ¶
Source code in components/offer_builder/internal/entities/builder_coverage.py
get_parameter ¶
to_guarantee_catalog_coverage_rule ¶
Source code in components/offer_builder/internal/entities/builder_coverage.py
BuilderCoverageRuleCostEstimate
dataclass
¶
builder_entity ¶
builder_product ¶
BuilderProduct
dataclass
¶
BuilderProduct(
*,
id,
country,
account_ref,
version_id,
version_number,
tags,
target_population,
primary_participation_percent,
partner_participation_percent,
child_participation_percent,
builder_targets,
coverages,
created_at
)
Bases: DataClassJsonMixin
Public BuilderProduct entity
builder_product_type ¶
builder_target ¶
BuilderTarget
dataclass
¶
BuilderTarget(
*,
id=uuid.uuid4(),
prospect_ref,
main_business_activity_code,
industry_framework_agreement_code
)
Bases: DataClassJsonMixin
Public BuilderTarget entity
builder_template ¶
BuilderTemplate
dataclass
¶
Builder template entity.
from_entity
staticmethod
¶
Convert an internal builder template to a public builder template.
Source code in components/offer_builder/public/entities/builder_template.py
factories ¶
builder_coverage ¶
BuilderCoverageFactory ¶
Bases: Factory
Factory for the public BuilderCoverage dataclass
Meta ¶
Part of the factory contract
price_by_price_target
class-attribute
instance-attribute
¶
price_by_price_target = LazyFunction(
lambda: {
None: Prices(
total=PriceDetails(
primary_cents=5000,
partner_cents=4500,
child_cents=3000,
family_cents=0,
),
membership_fee_ratio=Decimal("0.12"),
)
}
)
price_structure
class-attribute
instance-attribute
¶
builder_product ¶
BuilderProductFactory ¶
Bases: Factory[BuilderProduct]
Factory for the public BuilderProduct dataclass
builder_target ¶
BuilderTargetFactory ¶
Bases: Factory[BuilderTarget]
Factory for the public BuilderTarget dataclass
demographics ¶
ManualDemographicsEmptyFactory ¶
ManualDemographicsFactory ¶
Bases: Factory[ManualDemographics]
Factory for ManualDemographics.
prevoyance_builder_product_for_budget ¶
PrevoyanceBuilderProductForBudgetFactory ¶
Bases: AlanBaseFactory['PrevoyanceBuilderProductForBudget']
manual_demographics ¶
ManualDemographics
dataclass
¶
ManualDemographics(
*,
id=uuid.uuid4(),
prospect_ref,
version,
number_of_primaries,
average_age,
male_ratio,
target_population_ratios,
partner_ratio,
child_ratio,
non_paying_ratio,
coverage_taker_ratios,
country,
single_ratio,
first_child_ratio,
first_two_children_ratio,
option_taker_ratio
)
Bases: DataClassJsonMixin
Manual demographics allow defining custom demographics (that override the demographics estimated by the pricer) when we have information about a prospect and the prospect is sufficiently large so that we can tailor the offer to this demographics.
manual_prices ¶
ManualPricesAPISchema
dataclass
¶
ManualPricesAPISchema(
primary_cents,
partner_cents,
family_cents,
child_cents,
nth_children_free,
)
Bases: DataClassJsonMixin
Defines the price structure as a set of desired prices.
For options the prices represent the incremental cost of the option compared to the base coverage.
__post_init__ ¶
Ensures that the desired manual prices are allowed
Source code in components/offer_builder/public/entities/manual_prices.py
to_price_structure ¶
Converts manual prices to a price structure that can be understood by the pricing logic.
Source code in components/offer_builder/public/entities/manual_prices.py
ManualPricesSetAPISchema
dataclass
¶
Bases: DataClassJsonMixin
Set of desired manual prices. There has to be exactly as many manual prices defined as there are coverages on the builder product.
__post_init__ ¶
Ensures that all desired manual prices share a similar price structure
Source code in components/offer_builder/public/entities/manual_prices.py
price_details ¶
PriceDetails
dataclass
¶
Bases: DataClassJsonMixin
Details of price for each group of persons: - primary: price for the primary holder of the insurance policy - partner: price for the partner of the primary - child: price for the children (may be per child, for several children or for all children depending on context) - family: price for the family of the primary, excluding the primary (so partner + children)
add ¶
Add two PriceDetails instances together and return a new PriceDetails instance
Source code in components/offer_builder/public/entities/price_details.py
multiply ¶
Multiply the price details by a multiplier and return a new PriceDetails instance
Source code in components/offer_builder/public/entities/price_details.py
round ¶
Round the price details to a given precision and return a new PriceDetails instance
Source code in components/offer_builder/public/entities/price_details.py
substract ¶
Subtract one PriceDetails instance from another and return a new PriceDetails instance
Source code in components/offer_builder/public/entities/price_details.py
sum
classmethod
¶
Sum a list of PriceDetails instances
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
price_details
|
list[PriceDetails]
|
List of PriceDetails instances to sum together |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PriceDetails
|
A new PriceDetails instances with summed values. |
|
NB |
PriceDetails
|
Passing an empty list will results in 0 values for all fields. |
Source code in components/offer_builder/public/entities/price_details.py
weighted_average
classmethod
¶
Compute the weighted average of a list of PriceDetails instances
Source code in components/offer_builder/public/entities/price_details.py
with_price_increase ¶
Increase the price details by a price_increase ratio and return a new PriceDetails instance.
price_increase: float, the ratio to increase the price by. EG: 0.05 for a 5% increase.
Source code in components/offer_builder/public/entities/price_details.py
zeros
classmethod
¶
Return a new PriceDetails instance with all values set to 0
pricer ¶
CoverageWithPurePremiums
dataclass
¶
CoverageWithPurePremiums(
*,
selected_categories,
coverage_rules,
propagated_parameters,
aggregated_limit_parameters,
country_specific_data,
id,
coverage_index,
coverage_type,
premiumness,
price_structure,
past_results_correction_factor,
target_loss_ratio,
membership_fee_ratio,
priced_coverages,
pricing,
last_updated_at,
custom_settings,
demographics,
pure_premiums
)
Bases: BuilderCoverage
from_builder_coverage
staticmethod
¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/coverage_with_pure_premiums.py
Premiums
dataclass
¶
__add__ ¶
__mul__ ¶
__rmul__ ¶
__sub__ ¶
__truediv__ ¶
divide_by_number_of_beneficiaries ¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/premiums.py
get_policy_average_total_premiums ¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/premiums.py
multiply_by_number_of_beneficiaries ¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/premiums.py
sum
classmethod
¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/premiums.py
to_builder_coverage_rule_cost_estimate ¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/premiums.py
PriceComponentIdentifier
dataclass
¶
PricerDemographics
dataclass
¶
PricerDemographics(
*,
average_age,
male_ratio,
target_population_ratios,
manual_demographics_id=None,
number_of_primaries,
partner_ratio,
child_ratio,
non_paying_ratio,
coverage_taker_ratio,
single_ratio=None,
first_child_ratio=None,
first_two_children_ratio=None,
option_taker_ratio=None
)
Bases: PurePremiumsDemographicsInput
sum
staticmethod
¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/pricer_demographics.py
to_computed_demographics ¶
Source code in components/offer_builder/subcomponents/pricer/internal/entities/pricer_demographics.py
PurePremiumsInput
dataclass
¶
PurePremiumsInput(
*,
identifier,
coverage_rules,
aggregated_limit_parameters,
partner_primary_price_ratio,
family_primary_price_ratio,
location=None,
industry=None,
country_specific_input=None
)
SnapshotTestCase ¶
Bases: TestCase
The module provides tools and assertion methods to compare any dictionary results to a previously saved snapshot. All snapshots are named using the test method name which call assertMatchSnapshot(). It saves the results in JSON format.
should_rewrite_snapshot: Defines if the actual result should be snapshot and overwritten instead of compared
assert_deep_almost_equal ¶
Source code in components/offer_builder/subcomponents/pricer/internal/e2e/snapshot.py
assert_match_snapshot ¶
This assertion method behaves differently depending on the should_rewrite_snapshot flag.
- When the flag is true, it stores the dictionary into a serialized JSON
- When the flag is false, it compares the current actual value to the previous serialized value
It uses strict assertDictEqual assertion
- tolerance is the acceptable relative distance between actual & expected float / int (0.01: 1%)
- kwargs are the same than assertAlmostEquals (places / msg / delta)
Source code in components/offer_builder/subcomponents/pricer/internal/e2e/snapshot.py
load
classmethod
¶
Source code in components/offer_builder/subcomponents/pricer/internal/e2e/snapshot.py
save
classmethod
¶
Source code in components/offer_builder/subcomponents/pricer/internal/e2e/snapshot.py
setUpClass
classmethod
¶
Source code in components/offer_builder/subcomponents/pricer/internal/e2e/snapshot.py
prices ¶
Prices
dataclass
¶
Bases: DataClassJsonMixin
An insurance price, made of premiums and membership fees PriceDetails.
By default, we represent the price as a total amount and a membership fee ratio, so that's how the class is initialized. We provide alternative initializers from premiums and membership fees.
__post_init__ ¶
Initialize the init=False fields
Source code in components/offer_builder/public/entities/prices.py
add ¶
from_premiums_and_membership_fees
classmethod
¶
Alternate initialization method for Prices, used for old plans where membership_fee_ratio is not necessarily constant
Source code in components/offer_builder/public/entities/prices.py
multiply ¶
Multiply the price by a multiplier and return a new Prices instance
Source code in components/offer_builder/public/entities/prices.py
round ¶
Round the price to a given precision and return a new Prices instance
Source code in components/offer_builder/public/entities/prices.py
substract ¶
Subtract one Prices instance from another and return a new Prices instance
sum
classmethod
¶
Sum a list of Prices instances
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prices
|
Iterable[Prices]
|
Iterable of Prices instances to sum together |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Prices
|
A new Prices instances with summed values and same membership fee ratio. |
|
NB |
Prices
|
Passing an empty list will results in 0 values for all price fields. |
Source code in components/offer_builder/public/entities/prices.py
weighted_average
classmethod
¶
Compute the weighted average of a list of Prices instances
Source code in components/offer_builder/public/entities/prices.py
with_price_increase ¶
Increase the price by a price_increase ratio and return a new Prices instance
price_increase: float, the ratio to increase the price by. EG: 0.05 for a 5% increase.
Source code in components/offer_builder/public/entities/prices.py
product ¶
ProductSummary
dataclass
¶
Bases: DataClassJsonMixin
Summary of a product that should appear in the Offer Builder
id: Identifier of the product. display_name: User friendly name of the product, to display in the UI. product_type: The type of the product. Global implem only supports 'health' but local implementations may define other types. is_proposal_ready: Whether or not the product is considered to be complete and usable in a contract proposal. In the case of health products, True iff the product is priced. scenario_id: Identifier of the builder scenario that the product is associated with. propsect_refs: List of prospect refs for which the product is relevant.
from_builder_product_summary
staticmethod
¶
Convert a BuilderProductSummary into a ProductSummary
Source code in components/offer_builder/public/entities/product.py
components.offer_builder.public.enums ¶
base_premiumness ¶
base_pricer_version ¶
BasePricerVersion ¶
Bases: AlanBaseEnum
Base class for pricer versions.
We create 1 enum per country, and we use this base class to define the common methods.
get_default
classmethod
¶
is_deprecated
classmethod
¶
Returns True if the pricer version is deprecated, ie if it's before the default version.
Source code in components/offer_builder/public/enums/base_pricer_version.py
is_supported
classmethod
¶
Returns True if the pricer version is supported.
Note that a deprecated version can still be supported. We typically support deprecated versions for ~3 months to allow ongoing deals to be concluded.
Source code in components/offer_builder/public/enums/base_pricer_version.py
builder_product_origin ¶
builder_product_tag ¶
BuilderProductTag ¶
Bases: AlanBaseEnum
Enum representing possible tags to be set on a builder product. BuilderProduct can be built with 2 main tags: - either "acquisition", if the builder product was created from a signature coverage, in an acquisition context - or "amendment", if the builder product was created from an existing offer/contract
- "renewal" tag comes on top of "amendment", and is used to specify if products changes part of a renewal campaign were used to create the product
- "merge" tag is used to specify if the product is a merge of multiple product changes
offer_builder_supported_country ¶
product_change_pricing_strategy ¶
ProductChangePricingStrategy ¶
Bases: AlanBaseEnum
Defines the pricing strategy we want to apply for product changes.
default_price_increasewill use the main price change defined in turing product changesmin_price_increasewill use the min_price_increase defined in turing product changes
components.offer_builder.public.errors ¶
ManualDemographicsError ¶
Bases: Exception
Custom exception class for manual demographics
PricerError ¶
Bases: BaseErrorCode
Error class for guarantee catalog validation failures.
Initialize a guarantee catalog error with type and description.
Source code in components/offer_builder/subcomponents/pricer/protected/errors.py
builder_product_already_priced
classmethod
¶
Create error if trying to price an already priced builder product.
Source code in components/offer_builder/subcomponents/pricer/protected/errors.py
missing_builder_targets
classmethod
¶
Create error if trying to price a builder product without targets.
Source code in components/offer_builder/subcomponents/pricer/protected/errors.py
unsupported_pricer_version
classmethod
¶
Create error if trying to use an unsupported pricer version.
Source code in components/offer_builder/subcomponents/pricer/protected/errors.py
components.offer_builder.public.exceptions ¶
components.offer_builder.public.queries ¶
builder_template ¶
get_closest_builder_template ¶
get_closest_builder_template(
filters,
builder_product,
builder_coverage_selector,
exclude_guarantee_predicate=lambda _guarantee_ref: False,
)
Get the builder template matching the filters closest to the provided BuilderProduct. The comparison is performed by comparing the most relevant coverage (selected by builder_coverage_selector) of the provided BuilderProduct to the most relevant coverage of each candidate template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
dict[str, set[str]]
|
The filters to apply to templates country specific data to retrieve candidate templates. This is formatted as a dictionary with country specific data keys as the filter name and values as the filter values. |
required |
builder_product
|
BuilderProduct
|
The builder product to compare against the templates. |
required |
builder_coverage_selector
|
Callable[[BuilderProduct], BuilderCoverage]
|
A function that extracts the relevant BuilderCoverage (for comparison) from a BuilderProduct. |
required |
exclude_guarantee_predicate
|
Callable[[str], bool]
|
A function that is given a guarantee_ref, and returns True if the guarantee ref should be ignored for the purpose of finding a template. |
lambda _guarantee_ref: False
|
Returns:
| Type | Description |
|---|---|
BuilderTemplate | None
|
The closest builder template or None if no template matching the filters is found. |
Source code in components/offer_builder/public/queries/builder_template.py
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 | |
competitor ¶
get_competitors ¶
Source code in components/offer_builder/competitor_product/queries/competitor.py
prevoyance_builder_product_for_budget ¶
get_prevoyance_builder_product_for_budget_from_prevoyance_builder_product_id ¶
get_prevoyance_builder_product_for_budget_from_prevoyance_builder_product_id(
prevoyance_builder_product_id,
)
Get the prevoyance builder product for budget linked to a prevoyance builder product, if any. This is used to update the prevoyance_offer_ref of the prevoyance_builder_product_for_budget when the prevoyance_builder_product is published.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prevoyance_builder_product_id
|
UUID
|
The id of the prevoyance builder product |
required |
Returns:
| Type | Description |
|---|---|
PrevoyanceBuilderProductForBudget | None
|
A prevoyance builder product for budget or None if no budget product is linked to the prevoyance builder product |
Source code in components/offer_builder/public/queries/prevoyance_builder_product_for_budget.py
components.offer_builder.public.testing ¶
This file exposes functions that are useful for testing externally.
GuaranteeParametersOverrides
module-attribute
¶
LoadTuringProductChangePricingInput
dataclass
¶
LoadTuringProductChangePricingInput(
*,
price_increase=not_set_field(float | None),
min_price_increase=not_set_field(float | None),
membership_fee_ratio=not_set_field(float | None),
projected_loss_ratio=not_set_field(float | None)
)
get_mock_handle_offer_builder_creation_command ¶
Returns a function suitable to mock handle_offer_builder_creation_command
- Useful for letting dependencies test their code.
- Users can pass a BuilderProduct (public dataclass) to customize the return value.
Usage:
mocker.patch(
"components.offer_builder.public.api.handle_offer_builder_creation_command",
side_effect=get_mock_price_builder_product(),
)
Source code in components/offer_builder/public/testing.py
get_mock_price_builder_product ¶
Returns a function suitable to mock price_builder_product
Usage:
mocker.patch(
"components.offer_builder.internal.command_handlers.create_builder_product_from_template.price_builder_product",
side_effect=get_mock_price_builder_product(pricer_version=..., coverage_price_by_target=[...]),
)
Source code in components/offer_builder/public/testing.py
load_turing_product_change_from_builder_template ¶
load_turing_product_change_from_builder_template(
template_name,
product_id,
builder_product_id,
product_change_id=None,
account_id=None,
pricing_input=None,
is_default=True,
alternative_name="default",
campaign_name=None,
guarantee_parameter_overrides=None,
)
Loads a Turing product change from a builder template and creates a new turing product change instance.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the function is called in production mode. |
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in components/offer_builder/public/testing.py
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 | |
components.offer_builder.public.types ¶
components.offer_builder.public.v1 ¶
actions ¶
builder_product ¶
delete_builder_products ¶
delete_builder_products(
builder_product_ids=None,
account_refs=None,
origin=None,
delete_empty_scenarios=False,
any_version_has_plan=None,
)
Source code in components/offer_builder/internal/v1/actions/builder_product.py
prevoyance ¶
delete_prevoyance_builder_products_for_budget ¶
Source code in components/offer_builder/internal/v1/actions/prevoyance_builder_product_for_budget.py
duplicate_prevoyance_builder_product_for_budget ¶
duplicate_prevoyance_builder_product_for_budget(
id,
builder_scenario_id=None,
creator_profile_id=None,
creator_id=None,
)
Source code in components/offer_builder/internal/v1/actions/prevoyance_builder_product_for_budget.py
builder_product ¶
create_prevoyance_builder_product_from_contracts ¶
create_prevoyance_builder_product_from_contracts(
account_ref,
contract_version_ids,
origin,
tags,
prevoyance_offer_ref=None,
builder_scenario_id=None,
creator_profile_id=None,
)
Source code in components/offer_builder/internal/v1/actions/prevoyance_builder_product_for_budget.py
controllers ¶
builder_product ¶
BuilderProductController ¶
Bases: BaseController
get ¶
Source code in components/offer_builder/public/v1/controllers/builder_product.py
version ¶
Source code in components/offer_builder/public/v1/controllers/builder_product.py
manual_demographics ¶
ManualDemographicsController ¶
Bases: BaseController
post ¶
Source code in components/offer_builder/public/v1/controllers/manual_demographics.py
get_current ¶
Source code in components/offer_builder/public/v1/controllers/manual_demographics.py
search ¶
Source code in components/offer_builder/public/v1/controllers/manual_demographics.py
prevoyance ¶
PrevoyanceOfferController ¶
Bases: BaseController
create_product ¶
Create a new prevoyance builder product for budget.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
create_tailored_builder_product ¶
Create a new tailored prevoyance builder product.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
delete ¶
Delete a prevoyance builder product for budget.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
duplicate ¶
Duplicate a prevoyance builder product for budget.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
get_product ¶
Get a single prevoyance builder product for budget by ID.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
search ¶
Search prevoyance offers by CCN codes.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
update ¶
Update a prevoyance builder product for budget.
Source code in components/offer_builder/public/v1/controllers/prevoyance.py
sales_xp_builder_product ¶
SalesXpBuilderProductController ¶
Bases: BaseController
This controller serves builder products but as we already have a bunch of routes dedicated to another context, using a separate set of routes/endpoints feels simpler to understand.
create_from_competitor_product_id ¶
Create new product from a competitor product
Source code in components/offer_builder/public/v1/controllers/sales_xp_builder_product.py
get_builder_product_summaries ¶
Source code in components/offer_builder/public/v1/controllers/sales_xp_builder_product.py
create_plan_from_builder_product_version ¶
create_plan_from_builder_product_version ¶
create_plan_from_builder_product_version(
builder_product_version_id,
professional_category,
standard_plan_payload=None,
include_alsace_moselle_prices=False,
has_assistance=True,
has_aan_contribution=None,
plan_context=None,
bypass_blockers=False,
allow_non_responsible_base_with_options=None,
)
Create a plan from a builder product version.
Also sets the builder_product_version as frozen.
Source code in components/offer_builder/public/v1/create_plan_from_builder_product_version.py
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 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 | |
create_price_metadata ¶
Source code in components/offer_builder/public/v1/create_plan_from_builder_product_version.py
get_or_create_plan_from_builder_product_version ¶
get_or_create_plan_from_builder_product_version(
builder_product_version_id,
professional_category,
include_alsace_moselle_prices=False,
)
Get the existing plan for the given parameters If it doesn't exist, it creates a new plan
Source code in components/offer_builder/public/v1/create_plan_from_builder_product_version.py
get_plan_type ¶
entities ¶
builder_product_api ¶
BuilderCoverageAPISchema
dataclass
¶
BuilderCoverageAPISchema(
coverage_rules=list(),
selected_care_types=None,
option_number=None,
coverage_level=None,
past_results_correction_factor=None,
target_loss_ratio=NOT_SET,
membership_fee_percent_literal=NOT_SET,
membership_fee_ratio=NOT_SET,
alsace_moselle_price_ratio=NOT_SET,
custom_settings=NOT_SET,
)
Bases: DataClassJsonMixin, DataClassJsonAlanMixin
__post_init__ ¶
Source code in components/offer_builder/public/v1/entities/builder_product_api.py
alsace_moselle_price_ratio
class-attribute
instance-attribute
¶
membership_fee_percent_literal
class-attribute
instance-attribute
¶
past_results_correction_factor
class-attribute
instance-attribute
¶
BuilderProductAPISchema
dataclass
¶
BuilderProductAPISchema(
base_coverage=None,
option_coverages=list(),
company_demographics_id=None,
display_name=None,
salesforce_opportunity_id=None,
gsheet=None,
price_structure=None,
price_structure_coefficients=None,
builder_targets=None,
builder_entities=None,
ccn_collective_agreement_ids=NOT_SET,
template_id=NOT_SET,
enable_hospital_cap_cost_of_care_reduction=None,
competitor_product_id=NOT_SET,
invalidate_pricing_first=None,
return_current_version=None,
return_issues=None,
return_coverage_table=None,
primary_participation_percent=NOT_SET,
partner_participation_percent=NOT_SET,
child_participation_percent=NOT_SET,
builder_scenario_id=NOT_SET,
)
Bases: DataClassJsonMixin
ccn_collective_agreement_ids
class-attribute
instance-attribute
¶
child_participation_percent
class-attribute
instance-attribute
¶
enable_hospital_cap_cost_of_care_reduction
class-attribute
instance-attribute
¶
option_coverages
class-attribute
instance-attribute
¶
partner_participation_percent
class-attribute
instance-attribute
¶
price_structure_coefficients
class-attribute
instance-attribute
¶
primary_participation_percent
class-attribute
instance-attribute
¶
BuilderProductCoverageRuleAPISchema
dataclass
¶
Bases: DataClassJsonMixin
from_builder_product_coverage_rule
staticmethod
¶
Source code in components/offer_builder/public/v1/entities/builder_product_api.py
BuilderProductGSheetAPISchema
dataclass
¶
BuilderProductSelectedCareTypeAPISchema
dataclass
¶
BuilderProductSelectedCareTypeAPISchema(
guarantee_short_code,
care_type_short_code,
care_type_label,
)
Bases: DataClassJsonMixin
from_builder_product_selected_care_type
staticmethod
¶
Source code in components/offer_builder/public/v1/entities/builder_product_api.py
BuilderTargetAPISchema
dataclass
¶
BuilderTargetAPISchema(
id=None,
ape_code=None,
ccn_code=None,
franchise_id=None,
postal_code=None,
professional_category=None,
company_creation_year=None,
number_of_primaries=None,
prospect_ref=None,
)
Bases: DataClassJsonMixin, DataClassJsonAlanMixin
__post_init__ ¶
validate ¶
Source code in components/offer_builder/public/v1/entities/builder_product_api.py
PriceStructureCoefficientsAPISchema
dataclass
¶
PriceStructureCoefficientsAPISchema(
*,
partner_coefficient,
child_coefficient,
family_coefficient,
nth_children_free
)
Bases: PriceStructureCoefficients, DataClassJsonMixin, DataClassJsonAlanMixin
from_price_structure
staticmethod
¶
Converts from PriceStructure to PriceStructureCoefficientsAPISchema
Source code in components/offer_builder/public/v1/entities/builder_product_api.py
builder_product_card ¶
BuilderProductCard
dataclass
¶
BuilderProductCard(
builder_product_ref,
builder_product_version_ref,
coverage_level,
name,
description,
emoji,
base_price,
option_prices,
plan_ref=None,
is_renewal=False,
is_current_plan=False,
start_date=None,
)
Bases: DataClassJsonMixin
BuilderProductCardPrice
dataclass
¶
ccn_collective_agreement_api ¶
CCNCollectiveAgreementAPISchema
dataclass
¶
Bases: DataClassJsonMixin, DataClassJsonAlanMixin
API schema for providing CCN collective agreements to use for compliance check in a BuilderProduct.
ccn_id: The identifier of the CCN. collective_agreement_id: The identifier of the collective agreement - if not specified, selects all extended collective agreements for the CCN.
coverage_api ¶
GuaranteeViolationAPISchema
dataclass
¶
for_display ¶
builder_coverage_for_display ¶
BuilderCoverageForDisplay
dataclass
¶
BuilderCoverageForDisplay(
id,
option_number,
coverage_level,
coverage_rules,
selected_care_types,
is_responsible,
pricing,
price_structure,
price_structure_coefficients,
past_results_correction_factor,
target_loss_ratio,
membership_fee_ratio,
updated_at,
)
Bases: DataClassJsonMixin
CoverageRuleForDisplay
dataclass
¶
SelectedCareTypeForDisplay
dataclass
¶
builder_pricing_for_display ¶
builder_product_for_display ¶
BuilderProductCreator
dataclass
¶
BuilderProductForDisplay
dataclass
¶
BuilderProductForDisplayShort
dataclass
¶
BuilderProductForDisplayShort(
id,
display_name,
created_at,
updated_at,
is_template,
is_allowed_above_business_max,
salesforce_opportunity_id,
gsheet,
competitor_product_id,
coverage_level,
origin,
tags,
current_version,
)
Bases: _BuilderProductForDisplayBase
builder_product_summary_for_display ¶
BuilderProductSummaryForDisplay
dataclass
¶
BuilderProductSummaryForDisplay(
id,
account_ref,
builder_scenario_id,
display_name,
version_number,
is_priced,
coverage_level,
competitor_product_id,
competitor_product_template_id,
google_spreadsheet_url,
google_spreadsheet_export,
last_updated_at,
instant_quote_ids,
targets,
professional_category,
origin,
tags,
is_using_global_guarantees,
)
Bases: DataClassJsonMixin
BuilderProductSummaryForDisplayGSheetExport
dataclass
¶
builder_product_version_for_display ¶
BuilderProductVersionForDisplay
dataclass
¶
BuilderProductVersionForDisplay(
id,
version,
builder_product_id,
display_name,
product_template_id,
template_signature_coverage_id,
base_coverage,
option_coverages,
is_latest_version,
is_priced,
prevoyance_1_5_rule_flag,
google_sheet_id,
created_at,
collective_agreement_ids,
ccn_collective_agreements,
enable_hospital_cap_cost_of_care_reduction,
actual_participation,
minimum_participation,
price_structure_coefficient_caps,
builder_targets=None,
output_metrics=None,
)
Bases: DataClassJsonMixin
instance-attribute
¶
BuilderProductVersionForDisplayShort
dataclass
¶
Participation
dataclass
¶
Participation(
primary_participation_percent,
partner_participation_percent=0,
child_participation_percent=0,
)
Bases: DataClassJsonMixin
builder_target_for_display ¶
BuilderTargetForDisplay
dataclass
¶
BuilderTargetForDisplay(
id,
ape_code,
ccn_code,
franchise_id,
postal_code,
professional_category,
company_creation_year,
number_of_primaries,
prospect_ref,
)
Bases: ProductTarget, DataClassJsonMixin
coverage_table ¶
BaseCoverageTableGuaranteeRow
dataclass
¶
BaseCoverageTableGuaranteeRow(
guarantee_type,
short_code,
label,
product_formula,
care_types,
secu_percent_reimbursement,
)
Bases: DataClassJsonMixin
BaseCoverageTableRow
dataclass
¶
CompetitorCoverageTable
dataclass
¶
CompetitorCoverageTableGuaranteeRow
dataclass
¶
CompetitorCoverageTableGuaranteeRow(
guarantee_type,
short_code,
label,
product_formula,
care_types,
secu_percent_reimbursement,
guarantee_values,
mutually_exclusive_guarantees,
)
CompetitorCoverageTableGuaranteeValue
dataclass
¶
CompetitorCoverageTableGuaranteeValue(
coverage_type,
option_number,
selected_mutually_exclusive_guarantee_short_code=None,
value=None,
selected_care_type_short_codes=None,
coverage_identifier=None,
is_optional=False,
parsed_value=None,
comment=None,
)
Bases: CoverageTableGuaranteeValue
CompetitorCoverageTableRow
dataclass
¶
Bases: BaseCoverageTableRow
This dataclass is a high level row in the coverage table. It aggregates multiple guarantees like OPTAM/NON_OPTAM, FOR_100_PCT_SANTE/FOR_NON_100_PCT_SANTE, and so on.
CompetitorCoverageTables
dataclass
¶
CoverageTable
dataclass
¶
CoverageTable(
rows,
coverage_count,
template_signature_coverage_id,
template_competitor_product_id,
)
Bases: DataClassJsonMixin
All guarantees sharing the same short_code_prefix are grouped in the same guarantee row.
That prefix is what's left when we remove the OPTAM / NON_OPTAM / ... suffixes.
CoverageTableCareType ¶
CoverageTableGuaranteeRow
dataclass
¶
CoverageTableGuaranteeRow(
guarantee_type,
short_code,
label,
product_formula,
care_types,
secu_percent_reimbursement,
guarantee_values,
mutually_exclusive_guarantees,
)
CoverageTableGuaranteeValue
dataclass
¶
CoverageTableGuaranteeValue(
coverage_type,
option_number,
selected_mutually_exclusive_guarantee_short_code=None,
value=None,
selected_care_type_short_codes=None,
coverage_identifier=None,
is_optional=False,
)
Bases: DataClassJsonMixin
Dump from CoverageRuleParameterSet + Information about which
Remove what's not needed for the frontend (because it's too specific to edge-cases).
CoverageTableRow
dataclass
¶
Bases: BaseCoverageTableRow
This dataclass is a high level row in the coverage table. It aggregates multiple guarantees like OPTAM/NON_OPTAM, FOR_100_PCT_SANTE/FOR_NON_100_CPCT_SANTE, and so on.
GuaranteeValueDetails
dataclass
¶
GuaranteeValueDetails(
*,
percent_reimbursement=None,
percent_reimbursement_of_total_cost=None,
max_reimbursement_per_care_in_euros=None,
frame_amount_in_euros=None,
limit_is_per_side=None,
cumulative_limit_in_euros=None,
cumulative_limit_includes_secu=None,
count_limit=None,
limit_window=None,
renewal_limit_window=None,
count_grouped_care_as_one_for_limit=None,
reimburse_100_pct_brss=None,
reimburse_full_cost=None,
sum_grouped_care_amounts_for_max_reimbursement_amount=None,
use_ccam_table_to_find_brss_when_zero_or_none=None,
default_brss_in_euros=None,
use_cumulative_limit_to_cover_above_brss_percent=None,
lump_sum_in_euros=None,
ignore_audio_accessories_in_count_limit=None,
grouping_for_limits=None,
percent_reimbursement_after_count_limit_reached=None,
max_reimbursement_per_care_in_euros_after_count_limit_reached=None
)
Bases: DataClassJsonMixin
class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶class-attribute
instance-attribute
¶
MutuallyExclusiveGuarantee
dataclass
¶
MutuallyExclusiveGuarantee(
guarantee_type,
short_code,
label,
product_formula,
care_types,
secu_percent_reimbursement,
guarantee_option_label,
)
manual_demographics_for_display ¶
ManualDemographicsForDisplay
dataclass
¶
ManualDemographicsForDisplay(
origin,
number_of_employees,
number_of_covered_employees=None,
average_age=None,
number_of_partners=None,
number_of_ani=None,
number_of_option_taker=None,
number_of_male=None,
number_of_cadre=None,
number_of_children=None,
number_of_single=None,
company_ref=None,
prospect_ref=None,
)
Bases: DataClassJsonMixin
Source code in components/offer_builder/public/v1/entities/for_display/manual_demographics_for_display.py
validate_manual_demographics ¶
Source code in components/offer_builder/public/v1/entities/for_display/manual_demographics_for_display.py
prevoyance ¶
PrevoyanceBuilderProductForBudgetForDisplay
dataclass
¶
PrevoyanceBuilderProductForBudgetForDisplay(
account_ref,
display_name,
offer,
prevoyance_builder_product,
tranche_1_participation_percent,
tranche_2_participation_percent,
builder_prospect_refs,
id,
competitor_product_id=None,
origin=None,
tags=None,
scenario_id=None,
)
Bases: DataClassJsonMixin
PrevoyanceBuilderProductForDisplay
dataclass
¶
Bases: DataClassJsonMixin
PrevoyanceOfferForDisplay
dataclass
¶
PrevoyanceOfferForDisplay(
id,
ccn_codes,
cnp_code,
professional_category,
libelle,
tranche_1_price,
tranche_2_price,
premium=False,
)
Bases: DataClassJsonMixin
signature_coverage_for_display ¶
subscribed_product_for_display ¶
manual_demographics ¶
ManualDemographics
dataclass
¶
ManualDemographics(
number_of_employees,
number_of_covered_employees=None,
average_age=None,
number_of_partners=None,
number_of_ani=None,
number_of_option_taker=None,
number_of_male=None,
number_of_cadre=None,
number_of_children=None,
number_of_single=None,
number_of_first_children=None,
number_of_first_two_children=None,
tranche_1_cadres_salary_sum=None,
tranche_2_cadres_salary_sum=None,
tranche_1_non_cadres_salary_sum=None,
tranche_2_non_cadres_salary_sum=None,
tranche_1_all_salary_sum=None,
tranche_2_all_salary_sum=None,
company_ref=None,
prospect_ref=None,
origin=ManualDemographicsOrigin.ACQUISITION,
id=None,
)
Bases: DataClassJsonMixin
child_ratio
property
¶
It used to be named children_per_primary_ratio.
Returns: Total number of children divided by the number of primaries.
children_per_primary_with_children_ratio
property
¶
Returns: Total number of children divided by the number of primaries with children .
first_child_ratio
property
¶
Use to be primary_with_children_ratio.
Number of primaries with children divided by the number of primaries
| Type | Description |
|---|---|
float | None
|
(equivalent to the number of first child divided by the number of primaries). |
first_two_children_ratio
property
¶
Use to be paying_children_ratio.
Returns: Number of children being the first or the second in the policy divided by the number of primaries.
from_dict
staticmethod
¶
Source code in components/offer_builder/public/v1/entities/manual_demographics.py
number_of_first_two_children
class-attribute
instance-attribute
¶
to_global_manual_demographics ¶
Convert a v1 ManualDemographics to a global ManualDemographics entity. Temporary helper function until we move product change logic to using global manual demographics.
Source code in components/offer_builder/public/v1/entities/manual_demographics.py
tranche_1_non_cadres_salary_sum
class-attribute
instance-attribute
¶
tranche_2_non_cadres_salary_sum
class-attribute
instance-attribute
¶
plan_payload ¶
PlanPayload
dataclass
¶
PlanPayload(
name,
display_name,
product,
category,
price_grid_name,
option_price_grid_names,
alsace_moselle_price_grid_name,
emoji_code,
start_date,
bundle_version,
assistance_type,
)
enums ¶
bucket_name ¶
BucketName ¶
Bases: AlanBaseEnum
from_number_of_employees
staticmethod
¶
Source code in components/offer_builder/public/v1/enums/bucket_name.py
coverage_change ¶
COVERAGE_CHANGE_EXPLANATIONS
module-attribute
¶
COVERAGE_CHANGE_EXPLANATIONS = {
ADD_ALAN_THERAPY_SESSION: "Two annual sessions of Alan Mind therapy sessions with a coach or psychologist will be added to the coverage.",
ADD_MIX_GLASSES_GUARANTEES: "Introduces guarantees related to mixed types glasses, aiming to provide a comprehensive coverage including different types of optical needs.",
ADD_CHILD_GLASSES_GUARANTEES: "Introduces guarantees for children glasses, ensuring that their unique needs are met and acknowledging the rapid changes in prescription that children may experience.",
UPDATE_DENTAL_PROSTHESIS_COST_OF_CLAIMS: "The update involves differentiating between controlled and standard baskets (paniers) of dental prosthesis to align with regulatory requirements.",
DEL_MEDITATION: "Removal of meditation from the list of covered guarantees.",
ADD_MISSING_GUARANTEES: "Involves adding guarantees that were previously overlooked or became necessary due to changes in healthcare needs or regulatory adjustments.",
ADD_PRIVATE_HOSPITAL_ROOM_LIMIT: "This change introduces a cap to private room hospital stays.",
REMOVE_ALAN_THERAPY_SESSION: "Removes the Alan Therapy Session guarantee.",
NON_COMPLIANT_ALTERNATIVE_MEDICINE: "Removes some alternative medicine guarantees that are now recognized as non-compliant.",
COMPLIANCE_FIX: "Compliance fix.",
ADD_OPTION: "Default option experiment.",
PRIVATE_ROOM_SPLIT_DAY_NIGHT: "A day hospital stay lasts a maximum of 12 hours and does not require the same comfort and privacy needs as a full night in the hospital. A collective day room (which costs €0) may be sufficient in the case of outpatient hospitalization.",
NON_REIMBURSED_DENTAL_PROSTHESIS_COUNT_LIMIT: "Fight against fraud: By capping the number of non-reimbursed dental prostheses to 3 per year, we can better control these atypical situations while maintaining optimal coverage for 99.96% of our members, a preventive measure that strengthens our responsible management of benefits. On average, a member needing non-reimbursed dental prostheses has 1.5 per year.",
DENTAL_IMPLANT_COUNT_LIMIT: "By transitioning from an annual package to a reimbursement model capped at 2 or 3 implants per year, we encourage more responsible dental care consumption, knowing that a member typically undergoes 1.4 implants annually. This change will prevent situations where the entire annual package is consumed for a single implant, potentially generating savings on consumption.",
PRIVATE_ROOM_CAP: "This change introduces a cap to private room hospital stays.",
ALAN_MIND_MERGE: "Deprecate the 'Alan Therapy' guarantee that gave access to the in-app therapists (a remnant of Alan Mind).",
}
CoverageChangeEnum ¶
Bases: AlanBaseEnum
ADD_ALAN_THERAPY_SESSION
class-attribute
instance-attribute
¶
ADD_CHILD_GLASSES_GUARANTEES
class-attribute
instance-attribute
¶
ADD_MISSING_GUARANTEES
class-attribute
instance-attribute
¶
ADD_MIX_GLASSES_GUARANTEES
class-attribute
instance-attribute
¶
ADD_PRIVATE_HOSPITAL_ROOM_LIMIT
class-attribute
instance-attribute
¶
CONTACT_LENS_NETWORK
class-attribute
instance-attribute
¶
DENTAL_IMPLANT_COUNT_LIMIT
class-attribute
instance-attribute
¶
NON_COMPLIANT_ALTERNATIVE_MEDICINE
class-attribute
instance-attribute
¶
NON_REIMBURSED_DENTAL_PROSTHESIS_COUNT_LIMIT
class-attribute
instance-attribute
¶
PRIVATE_ROOM_SPLIT_DAY_NIGHT
class-attribute
instance-attribute
¶
REMOVE_ALAN_THERAPY_SESSION
class-attribute
instance-attribute
¶
REMOVE_PRIVATE_HOSPITAL_ROOM_LIMIT
class-attribute
instance-attribute
¶
UPDATE_DENTAL_PROSTHESIS_COST_OF_CLAIMS
class-attribute
instance-attribute
¶
mandatory_changes
staticmethod
¶
Source code in components/offer_builder/public/v1/enums/coverage_change.py
with_mandatory_changes
classmethod
¶
Returns a list of coverage changes with the mandatory ones + the given ones.
Source code in components/offer_builder/public/v1/enums/coverage_change.py
helpers ¶
builder_product_version ¶
get_professional_category ¶
Source code in components/offer_builder/public/v1/helpers/builder_product_version.py
prevoyance ¶
to_prevoyance_builder_product_for_budget_for_display ¶
to_prevoyance_builder_product_for_budget_for_display(
model, prevoyance_offer, prevoyance_builder_product
)
Source code in components/offer_builder/public/v1/helpers/prevoyance.py
to_prevoyance_builder_product_for_display ¶
Source code in components/offer_builder/public/v1/helpers/prevoyance.py
to_prevoyance_offer_for_display ¶
Source code in components/offer_builder/public/v1/helpers/prevoyance.py
queries ¶
builder_scenario ¶
get_builder_scenario ¶
Source code in components/offer_builder/internal/v1/queries/v2/builder_scenario.py
get_builder_product_card ¶
get_builder_product_card ¶
Source code in components/offer_builder/internal/v1/queries/get_builder_product_card.py
get_builder_product_version_for_display ¶
get_builder_products_summaries ¶
get_builder_product_summaries ¶
Source code in components/offer_builder/public/v1/queries/get_builder_products_summaries.py
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 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 | |
list_builder_products ¶
list_builder_products ¶
list_builder_products(
builder_product_ids=None,
prospect_refs=None,
account_refs=None,
origin=None,
tags=None,
options=None,
any_version_has_plan=None,
)
Source code in components/offer_builder/public/v1/queries/list_builder_products.py
prevoyance ¶
get_prevoyance_builder_product_by_id ¶
Source code in components/offer_builder/public/v1/queries/prevoyance.py
get_prevoyance_builder_product_for_budget_for_display ¶
Get a single prevoyance builder product for budget by ID
Source code in components/offer_builder/public/v1/queries/prevoyance.py
get_prevoyance_offer_by_id ¶
Source code in components/offer_builder/public/v1/queries/prevoyance.py
get_prevoyance_offers_by_ccns ¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ccn_codes
|
set[str]
|
a list of ccn codes. |
required |
Returns: a list of prevoyance offers by ccn_codes.
Source code in components/offer_builder/public/v1/queries/prevoyance.py
list_prevoyance_builder_product_for_budget_for_display ¶
list_prevoyance_builder_product_for_budget_for_display(
account_ref=NOT_SET,
builder_scenario_ids=None,
prevoyance_builder_product_ids=None,
origin=NOT_SET,
tags=None,
)
Lists prevoyance builder products for budget entities