Api reference
components.contracting.public.admin_segment_fr ¶
AdminSegment ¶
Bases: Segment
Segment used for emailing to select Admin users based on their responsibilities within an account and optionally specific companies. TODO @jsagl - AdminSegment should probably be owned and exposed by a component responsible for managing admin/rights
list_recipients ¶
List Admin recipients for account_id provided in settings. Admins are selected based on the responsibilities provided in settings. At least one of account responsibilities or company responsibilities must be provided. If no company_ids are provided but company responsibilities are provided, all companies are considered. If company_ids are provided, only admins with responsibilities for those companies are considered.
Source code in components/contracting/public/admin_segment_fr.py
AdminSegmentSettings
dataclass
¶
AdminSegmentSettings(
account_id,
company_ids=None,
at_least_one_account_responsibilities=None,
at_least_one_company_responsibilities=None,
)
components.contracting.public.customer_insights ¶
components.contracting.public.entities ¶
DocumentProviderType ¶
EmployeeNotificationType ¶
HealthPrices
dataclass
¶
Bases: BaseProductPrices
has_changed ¶
Source code in components/contracting/external/price/fr/health_insurance.py
has_price_decreased ¶
Returns True if the price has decreased compared to the given 'other' price.
So, returns True if no dimensions of the price are greater than its counterpart in the 'other' price and if at least one dimension is lower.
Source code in components/contracting/external/price/fr/health_insurance.py
has_price_increased ¶
Returns True if the price has increase compared to the given 'other' price.
So, returns True if at least one dimension of the price is greater than its counterpart in the 'other' price.
Source code in components/contracting/external/price/fr/health_insurance.py
is_same ¶
InsightsReportType ¶
Bases: AlanBaseEnum
MetricsPerHealthSubscriptionEntity
dataclass
¶
MetricsPerHealthSubscriptionEntity(
account_ref,
subscriptor_ref,
subscription_ref,
contract_size,
n_employees=0,
n_live_primaries=0,
n_live_partners=0,
n_live_children=0,
n_live_families=0,
n_primaries_with_children=0,
n_1st_or_2nd_children=0,
n_live_primaries_option=0,
n_live_partners_option=0,
n_live_families_option=0,
n_1st_or_2nd_children_option=0,
n_primaries_with_children_option=0,
n_live_primaries_option2=0,
n_1st_or_2nd_children_option2=0,
n_primaries_with_children_option2=0,
)
This entity is used to expose the metrics per subscription. These insights are refreshed monthly.
PrevoyancePrices
dataclass
¶
Bases: BaseProductPrices
has_changed ¶
Source code in components/contracting/external/price/fr/prevoyance_insurance.py
has_price_decreased ¶
Returns True if the price has decreased compared to the given 'other' price. So, returns True if no dimensions of the price are greater than its counterpart in the 'other' price and if at least one dimension is lower.
Source code in components/contracting/external/price/fr/prevoyance_insurance.py
has_price_increased ¶
Returns True if the price has increase compared to the given 'other' price. So, returns True if at least one dimension of the price is greater than its counterpart in the 'other' price.
Source code in components/contracting/external/price/fr/prevoyance_insurance.py
SafeCustomerInsightsDashboard
dataclass
¶
Bases: DataClassJsonMixin
SubscriptorLegalStatus ¶
WorkflowRunUpdate
dataclass
¶
WorkflowRunUpdate(
started_at=None,
completed_at=None,
status=None,
document_check_result_status=None,
document_check_result_sub_status=None,
)
components.contracting.public.errors ¶
ProposalErrorCodes ¶
Bases: AlanBaseEnum
company_has_no_iban
class-attribute
instance-attribute
¶
compliance_with_1_5_rule
class-attribute
instance-attribute
¶
conflicting_proposal_item_exists
class-attribute
instance-attribute
¶
direct_billing_only_work_when_participation_for_children_and_partner_is_zero
class-attribute
instance-attribute
¶
direct_billing_only_work_when_participation_for_children_and_partner_is_zero = "direct_billing_only_work_when_participation_for_children_and_partner_is_zero"
expiration_date_in_past
class-attribute
instance-attribute
¶
health_contract_has_future_amendment
class-attribute
instance-attribute
¶
health_contract_has_no_ongoing_subscription
class-attribute
instance-attribute
¶
health_subscription_not_active_at_prevoyance_start
class-attribute
instance-attribute
¶
health_subscription_not_active_at_prevoyance_start = (
"health_subscription_not_active_at_prevoyance_start"
)
include_due_while_setup_act_is_not_due
class-attribute
instance-attribute
¶
internal_server_error
class-attribute
instance-attribute
¶
invalid_product_for_individual_tns_freelancer
class-attribute
instance-attribute
¶
legacy_contract_cancellation_date
class-attribute
instance-attribute
¶
legacy_health_contract_first_day_of_month
class-attribute
instance-attribute
¶
members_will_be_unsubscribed_from_options_by_default
class-attribute
instance-attribute
¶
members_will_be_unsubscribed_from_options_by_default = (
"members_will_be_unsubscribed_from_options_by_default"
)
new_proposal_item_starts_before_latest_offer_version
class-attribute
instance-attribute
¶
new_proposal_item_starts_before_latest_offer_version = (
"new_proposal_item_starts_before_latest_offer_version"
)
no_manual_renewal_proposal_on_automatic_renewal_account
class-attribute
instance-attribute
¶
no_manual_renewal_proposal_on_automatic_renewal_account = "no_manual_renewal_proposal_on_automatic_renewal_account"
no_subscription_matching_legacy_termination_target
class-attribute
instance-attribute
¶
no_subscription_matching_legacy_termination_target = (
"no_subscription_matching_legacy_termination_target"
)
no_switch_to_affiliation_based_billing
class-attribute
instance-attribute
¶
plan_is_not_compatible_with_one_of_the_target
class-attribute
instance-attribute
¶
proposal_does_not_start_on_first_day_of_month
class-attribute
instance-attribute
¶
proposal_item_has_no_start_date
class-attribute
instance-attribute
¶
proposal_item_product_is_same_as_current
class-attribute
instance-attribute
¶
proposal_start_date_first_day_of_month
class-attribute
instance-attribute
¶
proposal_start_date_in_the_past
class-attribute
instance-attribute
¶
renewal_month_should_be_january
class-attribute
instance-attribute
¶
requested_amendment_offer_is_the_same_as_ongoing_subscription_period
class-attribute
instance-attribute
¶
requested_amendment_offer_is_the_same_as_ongoing_subscription_period = "requested_amendment_offer_is_the_same_as_ongoing_subscription_period"
self_served_amendment_not_implemented
class-attribute
instance-attribute
¶
self_served_proposal_cannot_downgrade_under_commitment
class-attribute
instance-attribute
¶
self_served_proposal_cannot_downgrade_under_commitment = (
"self_served_proposal_cannot_downgrade_under_commitment"
)
self_served_proposal_item_should_have_one_target
class-attribute
instance-attribute
¶
self_served_proposal_item_should_have_one_target = (
"self_served_proposal_item_should_have_one_target"
)
self_served_proposal_policy_not_found_for_individual_user
class-attribute
instance-attribute
¶
self_served_proposal_policy_not_found_for_individual_user = "self_served_proposal_policy_not_found_for_individual_user"
self_served_proposal_user_is_not_individual
class-attribute
instance-attribute
¶
start_date_too_far_in_the_future
class-attribute
instance-attribute
¶
switch_to_dsn_billing
class-attribute
instance-attribute
¶
user_has_no_billing_iban
class-attribute
instance-attribute
¶
user_has_no_birth_date
class-attribute
instance-attribute
¶
user_has_no_ssn_or_ntt
class-attribute
instance-attribute
¶
user_with_active_contract
class-attribute
instance-attribute
¶
user_with_active_exemption
class-attribute
instance-attribute
¶
user_with_policy_not_in_ani
class-attribute
instance-attribute
¶
TerminationErrorCodes ¶
Bases: AlanBaseEnum
cannot_terminate_contract_for_key_account
class-attribute
instance-attribute
¶
cannot_terminate_contract_that_was_already_terminated
class-attribute
instance-attribute
¶
cannot_terminate_contract_that_was_already_terminated = (
"cannot_terminate_contract_that_was_already_terminated"
)
cannot_terminate_health_contract_without_terminating_prevoyance_contract
class-attribute
instance-attribute
¶
cannot_terminate_health_contract_without_terminating_prevoyance_contract = "cannot_terminate_health_contract_without_terminating_prevoyance_contract"
cannot_terminate_unbalanced_contract
class-attribute
instance-attribute
¶
self_termination_not_supported_for_individuals
class-attribute
instance-attribute
¶
self_termination_not_supported_for_individuals = (
"self_termination_not_supported_for_individuals"
)
termination_date_cannot_be_in_the_past
class-attribute
instance-attribute
¶
termination_date_cannot_be_more_than_3_months_from_now
class-attribute
instance-attribute
¶
termination_date_cannot_be_more_than_3_months_from_now = (
"termination_date_cannot_be_more_than_3_months_from_now"
)
user_does_not_have_access_to_all_health_contracts
class-attribute
instance-attribute
¶
user_does_not_have_access_to_all_health_contracts = (
"user_does_not_have_access_to_all_health_contracts"
)
user_does_not_have_access_to_all_prevoyance_contracts
class-attribute
instance-attribute
¶
user_does_not_have_access_to_all_prevoyance_contracts = (
"user_does_not_have_access_to_all_prevoyance_contracts"
)
ValidationContext
dataclass
¶
ValidationContext(
should_bypass_all_warnings=False,
warnings_to_bypass=list(),
warnings_to_consider=list(),
should_bypass_all_blockers=False,
blockers_to_bypass=list(),
noncompliance_acknowledgement_link=None,
should_persist_errors=True,
should_mark_errors_as_seen=False,
)
Bases: DataClassJsonMixin
This class is used to configure how the validation warnings & blockers should be handled.
You can define which warnings & blockers should be ignored using their code, or if all of them should be ignored.
Blockers can't be ignored in production mode, this is only provided to made testing easier.
__post_init__ ¶
Source code in components/contracting/utils/validation.py
blockers_to_bypass
class-attribute
instance-attribute
¶
noncompliance_acknowledgement_link
class-attribute
instance-attribute
¶
should_ignore_message ¶
Source code in components/contracting/utils/validation.py
warnings_to_bypass
class-attribute
instance-attribute
¶
warnings_to_consider
class-attribute
instance-attribute
¶
components.contracting.public.exceptions ¶
components.contracting.public.helpers ¶
controllers ¶
get_contracting_controllers ¶
Source code in components/contracting/public/helpers/controllers.py
components.contracting.public.insights ¶
components.contracting.public.language ¶
get_supported_languages ¶
Gets the supported languages for the given app_name
Source code in components/contracting/public/language.py
components.contracting.public.legal_document ¶
EsAlanEssentialCPInputs ¶
Bases: Inputs
Used to represent inputs needed to render a Spanish Alan Essential CP document
EsAlanEssentialNoticeInputs ¶
EsAlanHealthCPInputCoverageDetails ¶
Used to represent coverage details needed to render a Spanish Alan Health CP document
EsAlanHealthCPInputDates ¶
EsAlanHealthCPInputFlags ¶
EsAlanHealthCPInputs ¶
EsAlanHealthNoticeInputCoverageDetails ¶
Used to represent coverage details needed to render a Spanish Alan Health Notice document
EsAlanHealthNoticeInputDates ¶
Bases: EsNoticeInputDates
Used to represent dates needed to render a Spanish Alan Health Notice document
EsAlanHealthNoticeInputFlags ¶
Used to represent flags needed to render a Spanish Alan Health Notice document
EsAlanHealthNoticeInputs ¶
EsCGInputFlags ¶
Used to represent flags needed to render a Spanish general conditions document
EsCGInputs ¶
Bases: Inputs
A class used to represent the inputs needed to render CG document for ES Health.
EsCPInputDates ¶
Used to represent shared dates needed to render a Spanish CP document
EsCPInputFlags ¶
EsCPInputReferences ¶
Used to represent references needed to render a Spanish CP document
EsCPOptions ¶
Used to represent options needed to render a Spanish CP document
EsNoticeInputDates ¶
FrCGAANInputs ¶
Bases: Inputs
A class used to represent the inputs needed to render a French CG document.
It differs from FrCGInputs in the sense that it's intended at the association and thus include information about the price and coverage as well as legal content.
FrCGInputs ¶
FrCertificateHealthInputs ¶
FrCompaniesCPHealthInputs ¶
Bases: Inputs
A class used to represent the inputs needed to render Health CP and Notice for companies and collective_retirees segments in France.
FR Health Companies CP: https://docs.google.com/document/d/1a976b0FOF1K69r24xn5-4PphcJJ1MSMTID5ytf83gd0/edit ⧉
FR Health Companies Notice: https://docs.google.com/document/d/1P8fCRYn-uqxOX08qddW7A2NZyxCOqHZI/edit ⧉
FR Health Collective Retirees CP: https://docs.google.com/document/d/1OmugyJpuzjGpf_y234hZi5PqNs5jaKM0DnZD9jP5154/edit ⧉
FR Health Collective Retirees Notice: https://docs.google.com/document/d/1RzhOM67-V-4bJA-3LTL-8XfkRWAqKVua/edit ⧉
TODO: Haven't renamed to avoid too many conflicts for now, but should be renamed to something less specific
FrCpHealthInputFlags ¶
Used to represent flags needed to render a French health CP document
FrIndivAANHealthInputs ¶
Bases: Inputs
A class used to represent the inputs needed to render Health Notice for individual_tns and individual_evin segments in France.
FR Health Individual Notice:
FrIndivPrivateOrRetireeInputs ¶
Bases: Inputs
Used to represent the inputs needed to render Health Notice for individual_private and individual_retirees segments in France.
FrPrevoyanceInputs ¶
Bases: Inputs
A class used to represent the inputs needed to render Prevoyance for companies and companies_cnp segments in France. FR Prevoyance Companies Notice: https://docs.google.com/document/d/1ez66ziAuLshKMqo7pKLqC57Kj4k_HDhtDmwz3f0VBY0/edit ⧉
Inputs ¶
Base data type to represent the inputs we'll need to render a legal document. See render_legal_document for more details.
This class has the bare minimum that will be needed to resolve/lookup at the right template according to their release policy. Each context might require different inputs, in which case subclassing Inputs is the way.
Those inputs are sent to the relevant legal document context's init function.
document_id
class-attribute
instance-attribute
¶
This ID will be injected in the document template so it's possible to get it back from a PDF, or a merged PDF's specific page. See SIGNED_DOCUMENT_ID_MARKER.
generate_dummy
classmethod
¶
Generates dummy inputs for the given legal document identifier.
This is used to generate previews in the UI.
Source code in components/contracting/subcomponents/legal_document/public/inputs.py
LegalDocumentIdentifier
dataclass
¶
Bases: DataClassJsonMixin
With a legal document identifier, a context will be able to generate the proper template variables, and to fetch the proper document template to render as well.
LegalDocumentIdentifierMatcher ¶
Source code in components/contracting/subcomponents/legal_document/external/contexts/utils.py
__call__ ¶
render_legal_document ¶
render_legal_document(
legal_document_identifier,
inputs,
file_format,
fragment_overrides=NOT_SET,
_include_drafts_only_for_preview=False,
)
Source code in components/contracting/subcomponents/legal_document/internal/actions/rendering.py
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 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 | |
components.contracting.public.population ¶
components.contracting.public.proposal ¶
get_proposal_alert ¶
Return an alert when a proposal is waiting for approval by the admin.
Can be called with either: - company_id: returns alert for proposals of that company - account_id: returns alert for proposals of all companies in the account
At least one of company_id or account_id must be provided.
Source code in components/contracting/subcomponents/proposal/api/main.py
1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 | |
components.contracting.public.renewal ¶
get_contractee_renewal_operation ¶
get_contractee_renewal_operation(
account_id=None,
user_id=None,
contractee_renewal_operation_id=None,
campaign_name=None,
app_name=None,
active_campaign=True,
)
Fetches the contractee renewal operation for a given account and renewal year. If the campaign is not found, it raised a RenewalNotFoundException.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id
|
UUID
|
The unique identifier of the account. |
None
|
user_id
|
str
|
The unique identifier of the user. |
None
|
contractee_renewal_operation_id
|
UUID
|
The unique identifier of the account renewal campaign. |
None
|
campaign_name
|
str
|
The name of the campaign. |
None
|
app_name
|
AppName
|
The name of the app. |
None
|
active_campaign
|
bool
|
If True, only active campaign is considered. |
True
|
Source code in components/contracting/subcomponents/renewal/public/contractee_renewal_operation.py
get_contractee_renewal_operation_or_none ¶
get_contractee_renewal_operation_or_none(
account_id=None,
user_id=None,
campaign_name=None,
app_name=None,
active_campaign=True,
)
Fetches the contractee renewal operation for a given account and renewal year. If the campaign is not found, it returns None.
Source code in components/contracting/subcomponents/renewal/public/contractee_renewal_operation.py
is_alternative_renewal ¶
Check if the proposal is an alternative renewal proposal
Source code in components/contracting/subcomponents/renewal/public/proposal.py
is_automatic_renewal ¶
Check if the proposal is an automatic renewal proposal
Source code in components/contracting/subcomponents/renewal/public/proposal.py
is_manual_renewal ¶
Check if the proposal is a manual renewal proposal
Source code in components/contracting/subcomponents/renewal/public/proposal.py
is_renewal_employee_communication ¶
is_renewal_employee_communication(
subscription_period_ref,
subscription_type,
company_id,
professional_category,
)
Check if the communication is a renewal communication :param subscription_period_ref: Either health_contract_version_id or prevoyance_contract_version_ref :param subscription_type: Either health_insurance or prevoyance
Source code in components/contracting/subcomponents/renewal/public/proposal.py
components.contracting.public.self_serve_subscription ¶
self_serve_active_company_proposal_from_user ¶
Self Serve Active Company Proposal From User
Source code in components/contracting/public/self_serve_subscription.py
self_serve_create_or_update_company_proposal_for_user ¶
Create or update a user's company proposal for self-serve.
Source code in components/contracting/public/self_serve_subscription.py
self_serve_individual_proposal_from_user ¶
Self Serve Active Individual Proposal From User
Source code in components/contracting/public/self_serve_subscription.py
components.contracting.public.subscription ¶
api ¶
initialize_subscription ¶
initialize_subscription(
subscription_scope,
owner_type,
owner_ref,
payload_ref=None,
*,
commit=True
)
Source code in components/contracting/public/subscription/api.py
fr ¶
health_insurance ¶
Subscription
dataclass
¶
Bases: Timeline[SubscriptionPeriod]
get_period_by_id ¶
get_status ¶
Source code in components/contracting/external/subscription/api/entities/subscription.py
get_health_subscriptions_for_companies ¶
get_health_subscriptions_for_companies(
*company_ids,
include_ended=False,
include_will_end=True,
include_collective_retiree=False
)
Source code in components/contracting/external/subscription/fr/health_insurance.py
get_ongoing_or_upcoming_health_subscription_for_company ¶
get_ongoing_or_upcoming_health_subscription_for_company(
company_id, include_ended=False, include_will_end=True
)
Source code in components/contracting/public/subscription/fr/health_insurance.py
prevoyance_insurance ¶
get_prevoyance_subscriptions_for_companies ¶
get_prevoyance_subscriptions_for_companies(
*company_ids, include_ended=True, include_will_end=True
)
Source code in components/contracting/external/subscription/fr/prevoyance_insurance.py
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 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |
subscription ¶
BaseSubscription
dataclass
¶
BaseSubscriptionVersion ¶
Bases: WithValidityPeriod, Protocol
Subscription
dataclass
¶
Subscription(
id,
subscription_scope,
owner_type,
owner_ref,
payload_ref,
validity_period,
versions,
)
Bases: Generic[_T], BaseSubscription
SubscriptionScope ¶
Bases: AlanBaseEnum
Subscription's API can be configured to operate within a specific scope.
fr_legacy_termination
class-attribute
instance-attribute
¶
get_app_name ¶
Returns the app name associated with the subscription scope.
Source code in components/contracting/subcomponents/subscription/public/entities.py
SubscriptionUpdateModel ¶
Bases: BaseModel
Represents a change in a Subscription.
A subscription is identified by it's scope and reference and isn't materialized in the database through a table.
It records a period of time where subscription properties must apply.
It gives the ability to clear/delete the previously stored information by setting is_deletion to true.
If clients need additional context, we could either add it in the payload OR in a new context JSONB column.
__repr__ ¶
__table_args__
class-attribute
instance-attribute
¶
__table_args__ = (
Index(
"ix_subscription_update_unique_revision_by_reference_by_scope",
subscription_scope,
subscription_ref,
revision,
unique=True,
),
CheckConstraint(
"(is_deletion is true) = (payload_ref is null)",
name="subscription_is_deletion_or_have_payload",
),
{"schema": CONTRACTING_SCHEMA},
)
is_deletion
class-attribute
instance-attribute
¶
operation_ref
class-attribute
instance-attribute
¶
payload_ref
class-attribute
instance-attribute
¶
subscription_ref
class-attribute
instance-attribute
¶
subscription_scope
class-attribute
instance-attribute
¶
SubscriptionVersionModel ¶
Bases: BaseModel
Represents the evolution of the state of a Subscription.
A subscription is identified by it's scope and reference and isn't materialized in the database through a table.
It record the latest knowledge about which properties of the subscription should be active, and when.
__repr__ ¶
__table_args__
class-attribute
instance-attribute
¶
__table_args__ = (
Index(
"ix_subscription_version_scope_subscription_ref",
subscription_scope,
subscription_ref,
),
Index(
"ix_subscription_version_scope_and_payload_ref",
subscription_scope,
payload_ref,
),
ExcludeConstraint(
("subscription_scope", "="),
("subscription_ref", "="),
(
text("daterange(start_date, end_date, '[]')"),
"&&",
),
name="no_overlapping_subscription_version",
using="gist",
),
{"schema": CONTRACTING_SCHEMA},
)
operation_ref
class-attribute
instance-attribute
¶
payload_ref
class-attribute
instance-attribute
¶
subscription
class-attribute
instance-attribute
¶
subscription = relationship(
SubscriptionModel,
primaryjoin=lambda: and_(
subscription_scope == subscription_scope,
foreign(subscription_ref) == cast(id, String),
),
backref=backref(
"subscription_versions",
uselist=True,
order_by=lambda: asc(),
),
uselist=False,
viewonly=True,
)
subscription_ref
class-attribute
instance-attribute
¶
subscription_scope
class-attribute
instance-attribute
¶
admin_tools_contracting_subscriptions_blueprint
module-attribute
¶
admin_tools_contracting_subscriptions_blueprint = (
AdminToolsContractingSubscriptionsBlueprint(
name="admin_tools_contracting_subscriptions",
import_name=__name__,
template_folder="../internal/templates",
static_folder="../internal/static",
)
)
download_prevoyance_legal_document ¶
Source code in components/contracting/external/legal_documents.py
get_subscription ¶
get_subscription_by_id ¶
Source code in components/contracting/subcomponents/subscription/public/queries.py
get_subscription_version_timeline ¶
get_subscription_version_timeline(
subscription_scope,
subscription_ref,
subscription_version_serializer,
)
Source code in components/contracting/subcomponents/subscription/public/queries.py
get_subscription_version_timelines ¶
get_subscription_version_timelines(
subscription_scope,
subscription_refs,
subscription_version_serializer,
subscription_preload_options=tuple(),
payload_preload_options=tuple(),
)
Source code in components/contracting/subcomponents/subscription/public/queries.py
get_subscription_version_updates ¶
Source code in components/contracting/subcomponents/subscription/public/queries.py
get_subscriptions ¶
Source code in components/contracting/subcomponents/subscription/public/queries.py
get_subscriptions_for ¶
get_subscriptions_for(
owner_ref,
subscription_scope,
subscription_version_serializer,
period=None,
)
Return list of subscriptions for a given owner. :param owner_ref: Owner to return subscription to :param subscription_scope: filter subscription on this scope :param subscription_version_serializer: Your serialize for Subscription model :param period: if set, only subscription overlapping this period are returned
:return: GetSubscriptionsResult :raises EmptySubscriptionError: if only empty subscriptions are found
Source code in components/contracting/subcomponents/subscription/public/queries.py
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 | |
get_subscriptions_for_companies ¶
Source code in components/contracting/external/subscription/fr/queries.py
initialize_subscription ¶
Create a subscription, and a first version matching inputs Subscription reference is returned You should create at least 1 version to the subscription by calling 'record_subscription_updates'
Source code in components/contracting/subcomponents/subscription/internal/actions/initialize_subscribtion.py
list_periods ¶
list_periods(
app_name,
account_id=None,
contract_ids=None,
subscription_type=None,
has_end_date=None,
latest_periods_only=None,
period_date=None,
product_id=None,
)
List subscription periods for a given account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id
|
UUID
|
The unique identifier of the account. |
None
|
app_name
|
AppName
|
The name of the application. |
required |
subscription_type
|
SubscriptionType
|
The type of subscription to filter by. Sending None will return all subscription types. |
None
|
has_end_date
|
bool
|
Filter periods by whether they have an end date. Defaults to None. |
None
|
latest_periods_only
|
bool
|
If True, only the latest subscription periods are returned. Defaults to None. |
None
|
period_date
|
date
|
The date to filter ongoing periods. This is exclusive with latest_periods_only. Defaults to None. |
None
|
product_id
|
str
|
The product ID to filter periods by. Defaults to None. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If both period_date and latest_periods_only are provided or both are None. |
Returns:
| Type | Description |
|---|---|
list[SubscriptionPeriod]
|
list[SubscriptionPeriod]: A list of subscription periods matching the criteria. |
Source code in components/contracting/external/subscription/api/queries.py
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 | |
list_subscribed_products ¶
list_subscribed_products(
account_id,
app_name,
subscription_type=None,
has_end_date=None,
latest_periods_only=None,
period_date=None,
product_id=None,
)
Lists subscription periods grouped by product for a given account.
Returns:
| Type | Description |
|---|---|
list[SubscribedProduct]
|
list[SubscribedProduct]: A list of subscribed products with their associated periods. |
Source code in components/contracting/external/subscription/api/queries.py
record_subscription_updates ¶
Append the ordered updates to the existing subscription, fully rewriting its versions.
Source code in components/contracting/subcomponents/subscription/internal/actions/subscription_updates.py
types ¶
SubscriptionMixin ¶
get_simple_subscription_version_timeline ¶
Source code in components/contracting/subcomponents/subscription/public/mixins/subscription.py
get_subscription_version_timeline ¶
Source code in components/contracting/subcomponents/subscription/public/mixins/subscription.py
preload_subscription_timeline_option
classmethod
¶
Options to preload the graph of needed relationships to later serialize the timeline of subscription version efficiently.
Depending on the serialization function, some extra preload-options might be provided through subscription_options and payload_options.
Example to preload the timeline and get ready to use payload.prevoyance_plan:
PrevoyanceContract.query.options(
PrevoyanceContract.preload_subscription_timeline_options(
payload_options=[joinedload(PrevoyanceSubscriptionPayload.prevoyance_plan)],
)
)
See https://docs.sqlalchemy.org/en/latest/orm/queryguide/columns.html ⧉
Source code in components/contracting/subcomponents/subscription/public/mixins/subscription.py
record_subscription_updates ¶
Source code in components/contracting/subcomponents/subscription/public/mixins/subscription.py
SubscriptionPayloadMixin ¶
SubscriptionScope ¶
Bases: AlanBaseEnum
Subscription's API can be configured to operate within a specific scope.
fr_legacy_termination
class-attribute
instance-attribute
¶
get_app_name ¶
Returns the app name associated with the subscription scope.
Source code in components/contracting/subcomponents/subscription/public/entities.py
SubscriptionStatusEnum ¶
Bases: AlanBaseEnum
SubscriptionUpdateRequest ¶
SubscriptionVersionSerializer ¶
Bases: Generic[_T], ABC
Describe the kind of parameters our subscription version serializers can receive. The subscription and payload arguments are optional.
__call__
abstractmethod
¶
__call__(
*,
subscription_scope,
subscription_ref,
validity_period,
payload_ref,
operation_ref,
subscription,
payload,
timeline_proxy,
**kwargs
)