Api reference
components.offer_catalog.public.api ¶
OfferCatalogCommand
module-attribute
¶
get_offer ¶
Get an offer by id
Source code in components/offer_catalog/public/api.py
get_offer_for_builder_product_version ¶
Get an offer by builder product version id
Source code in components/offer_catalog/public/api.py
handle_offer_catalog_command ¶
Handle a command from the offer catalog component.
Source code in components/offer_catalog/public/api.py
components.offer_catalog.public.blueprint ¶
HealthInsuranceOfferCatalog ¶
Bases: ServerSideAdminToolBlueprint
offer_catalog_api_blueprint
module-attribute
¶
offer_catalog_api_blueprint_record_once ¶
Source code in components/offer_catalog/public/blueprint.py
offer_catalog_blueprint
module-attribute
¶
offer_catalog_blueprint = HealthInsuranceOfferCatalog(
name="offer_catalog",
import_name=__name__,
template_folder="../internal/templates",
static_folder="../internal/static",
)
record_once ¶
Source code in components/offer_catalog/public/blueprint.py
components.offer_catalog.public.commands ¶
create_offer_from_payload_command ¶
CreateOfferFromPayloadCommand
dataclass
¶
Bases: Generic[PriceTarget, PriceComponentType]
Command requesting to create a new offer from a payload
components.offer_catalog.public.controllers ¶
offer_version ¶
OfferVersionController ¶
Bases: BaseController
search ¶
Source code in components/offer_catalog/public/controllers/offer_version.py
subscription ¶
SubscriptionController ¶
Bases: BaseController
search ¶
This controller searches for subscriptions of companies identified by the search term. So we search for companies matching the search terms, then we return the subscriptions of those companies.
Source code in components/offer_catalog/public/controllers/subscription.py
components.offer_catalog.public.cost ¶
HealthPricesSummary
dataclass
¶
Price
dataclass
¶
from_health_prices
classmethod
¶
Source code in components/offer_catalog/public/cost.py
HealthSubscriptionSettings
dataclass
¶
from_settings
classmethod
¶
Source code in components/offer_catalog/public/cost.py
get_estimated_cost ¶
Source code in components/offer_catalog/public/cost.py
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 | |
get_estimated_cost_from_period ¶
Estimate the cost of a subscription period on a given date If offer version is provided, we use it to compute the prices instead of the subscription period's one
Source code in components/offer_catalog/public/cost.py
list_estimated_cost_periods ¶
Returns: list of PeriodEstimatedCost for each subscription period of type health_insurance. For now, we exclude prevoyance subscription.
Source code in components/offer_catalog/public/cost.py
components.offer_catalog.public.dependencies ¶
OfferCatalogDependency ¶
Bases: ABC, Generic[PriceTarget, PriceComponentType, TargetPopulation]
Abstract class defining the dependencies needed by the Offer Catalog component.
create_offer
abstractmethod
¶
Create an offer from a payload.
Returns the created offer.
Warning: Given the Offer objects are country specific, the global component doesn't know the type of returned object. So this method should take care of adding the objects to the DB session when needed (but not committing as this is the responsibility of the command handler).
Source code in components/offer_catalog/public/dependencies.py
get_country_code
abstractmethod
¶
get_offer
abstractmethod
¶
get_offer_for_builder_product_version
abstractmethod
¶
Returns the offers for a builder product version.
Source code in components/offer_catalog/public/dependencies.py
get_app_dependency ¶
Retrieve the Offer Catalog dependency from the current app.
Source code in components/offer_catalog/public/dependencies.py
set_app_dependency ¶
Set the Offer Catalog dependency of the current app.
Source code in components/offer_catalog/public/dependencies.py
components.offer_catalog.public.entities ¶
for_display ¶
BuilderProductVersion
dataclass
¶
EstimatedCost
dataclass
¶
compare ¶
Source code in components/offer_catalog/public/entities/for_display.py
EstimatedCostComparison
dataclass
¶
EstimatedCostComparison(
total_cost_diff_in_euros,
total_cost_diff_in_percent,
company_cost_diff_in_euros,
company_cost_diff_in_percent,
employee_cost_diff_in_euros,
employee_cost_diff_in_percent,
)
EstimatedCostLine
dataclass
¶
CostDetails
dataclass
¶
__post_init__ ¶
Source code in components/offer_catalog/public/entities/for_display.py
__post_init__ ¶
Source code in components/offer_catalog/public/entities/for_display.py
compare ¶
Source code in components/offer_catalog/public/entities/for_display.py
HealthSubscriptionInsights
dataclass
¶
HealthSubscriptionInsights(
n_primaries_with_children,
n_primaries_with_children_option,
n_primaries_with_children_option2,
n_1st_or_2nd_children,
n_1st_or_2nd_children_option,
n_1st_or_2nd_children_option2,
n_live_primaries,
n_live_partners,
n_live_families,
n_live_primaries_option,
n_live_partners_option,
n_live_families_option,
)
from_metrics
classmethod
¶
Source code in components/offer_catalog/public/entities/for_display.py
OfferCategory ¶
OfferCriterionName ¶
OfferVersion
dataclass
¶
OfferVersion(
id,
bundle_version,
emoji_code,
offer_name,
professional_category,
start_date,
category,
visibility,
document_version,
type,
number_of_options,
prices,
builder_product_version=None,
)
OfferVersionCriterionName ¶
Bases: SearchCriterionName
get_criterion_parameters
classmethod
¶
Source code in components/offer_catalog/public/entities/for_display.py
professional_category
class-attribute
instance-attribute
¶
PeriodEstimatedCost
dataclass
¶
PrevoyanceOfferVersionCriterionName ¶
SearcheableOfferItem
dataclass
¶
Bases: SearcheableItem[OfferCriterionName]
SearcheableOfferVersionItem
dataclass
¶
SearcheableOfferVersionItem(
id,
bundle_version,
emoji_code,
offer_name,
type,
professional_category,
start_date,
visibility,
number_of_options,
active,
closed_contract_count,
open_contract_count,
open_policy_count,
)
Bases: SearcheableItem[OfferVersionCriterionName]
get_search_criteria ¶
Source code in components/offer_catalog/public/entities/for_display.py
get_search_keywords ¶
SearcheablePrevoyanceOfferVersionItem
dataclass
¶
SearcheablePrevoyanceOfferVersionItem(
id,
insurer_name,
cnp_code,
cnp_libelle,
price_ta,
price_tb,
price_tc,
professional_category,
ccn_codes,
ccn_codes_only,
created_at,
closed_contract_count,
open_contract_count,
eligible_employee_count,
)
Bases: SearcheableItem[PrevoyanceOfferVersionCriterionName]
get_search_criteria ¶
Source code in components/offer_catalog/public/entities/for_display.py
get_search_keywords ¶
guarantee_parameters ¶
AggregatedLimitParameter
module-attribute
¶
BundleChoiceParameter
dataclass
¶
CategoryParameter
dataclass
¶
CoverageRuleParameter
dataclass
¶
PropagatedParameter
module-attribute
¶
offer ¶
Offer
dataclass
¶
Bases: DataClassJsonMixin, Generic[TargetPopulation]
An offer, ie an item that Alan can propose to a client.
offer_payload ¶
OfferCoverage
dataclass
¶
OfferCoverage(
*,
name,
coverage_index,
coverage_type,
selected_categories,
coverage_rules,
propagated_parameters,
aggregated_limit_parameters,
price_grids,
country_specific_data=None
)
OfferCoverageRule
dataclass
¶
OfferCoverageRule(
*,
guarantee_ref,
bundle_choice_ref,
expression_type,
parameters,
eligibility_items_refs
)
Bases: DataClassJsonMixin
A coverage rule with associated parameters, eligibility items and cost estimates
OfferPayload
dataclass
¶
Bases: DataClassJsonMixin, Generic[PriceTarget, PriceComponentType]
Command requesting to create a new offer
OfferPriceGrid
dataclass
¶
OfferPriceGrid(
*,
target,
component_type,
tax_rate,
nth_children_free,
max_child_age,
price_rules
)
Bases: DataClassJsonMixin, Generic[PriceTarget, PriceComponentType]
A price_grid for a target and component_type
OfferPriceRule
dataclass
¶
OfferPriceRule(
*,
min_age,
max_age=None,
primary_cents=0,
partner_cents=0,
child_cents=0,
family_cents=0,
primary_membership_fee_cents=0,
partner_membership_fee_cents=0,
child_membership_fee_cents=0,
family_membership_fee_cents=0
)
Bases: DataClassJsonMixin
A price_rule, ie prices per enrollment_type and age_bracket
__add__ ¶
Add two price_rules into a new price_rule
Source code in components/offer_catalog/public/entities/offer_payload.py
PriceComponentType
module-attribute
¶
components.offer_catalog.public.offer ¶
paginate_offers ¶
Source code in components/offer_catalog/public/offer.py
components.offer_catalog.public.offer_version ¶
get_offer_version ¶
Source code in components/offer_catalog/public/offer_version.py
get_offer_versions ¶
Source code in components/offer_catalog/public/offer_version.py
paginate_offer_versions ¶
paginate_offer_versions(
filters,
eligible_for_company_id,
eligible_for_ccn_code,
corresponding_builder_product_id=None,
page=1,
per_page=1000,
)