Api reference
components.healthy_benefits.public.affiliation ¶
EnrollArgs
dataclass
¶
Enrollment
dataclass
¶
Enrollment(
id,
benefit_type,
subscription_id,
transfer_history_id,
profile_ref,
start_date=isodate_field(),
end_date=optional_isodate_field(default=None),
is_cancelled=False,
)
EnrollmentModelBroker ¶
Bases: BaseModelBroker
cancel_enrollment
classmethod
¶
cancel_enrollments
classmethod
¶
create_enrollment
classmethod
¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_active_or_ended_benefit_enrollment
classmethod
¶
get_active_or_ended_benefit_enrollment(
profile_ref,
at_date,
benefit_type,
subscription_ref=None,
)
Retrieve the most recent enrollment based on the given profile reference, date, and benefit type, optionally filtering by subscription reference.
This method will return the most recent benefit enrollment that is either active or ended as of a specified date for a given benefit type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cls
|
type
|
The class on which this method is called. |
required |
profile_ref
|
str
|
The profile reference to filter enrollments. |
required |
at_date
|
date
|
The date at which the enrollment status is checked. |
required |
benefit_type
|
BenefitType
|
The type of benefit to filter enrollments. |
required |
subscription_ref
|
str | None
|
Optional; A subscription reference to further filter the enrollments. |
None
|
Returns:
| Type | Description |
|---|---|
HealthyBenefitsEnrollment | None
|
Enrollment | None: The most recent Enrollment object that meets the criteria, or None if no enrollment is found. |
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_ended_enrollments
classmethod
¶
get_ended_enrollments(
at_date=None,
profile_refs=None,
benefit_types=None,
subscription_refs=None,
)
Retrieve all ended enrollments as of a specific date.
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_enrollment
classmethod
¶
get_enrollment_by_ids
classmethod
¶
get_enrollment_by_transfer_history_ref
classmethod
¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_enrollments
classmethod
¶
get_enrollments(
active_on=None,
ended_on=None,
active_on_or_after=None,
profile_refs=None,
benefit_types=None,
subscription_refs=None,
)
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_enrollments_active_after
classmethod
¶
get_enrollments_active_after(
active_after,
profile_refs=None,
benefit_types=None,
subscription_refs=None,
)
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_enrollments_active_in_period
classmethod
¶
get_enrollments_active_in_period(
period,
profile_refs=None,
benefit_types=None,
subscription_refs=None,
)
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
get_enrollments_active_on
classmethod
¶
get_enrollments_active_on(
active_on,
profile_refs=None,
benefit_types=None,
subscription_refs=None,
)
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
terminate_enrollment
classmethod
¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
update_enrollment
classmethod
¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/enrollment.py
TemporaryLeave
dataclass
¶
Represents a temporary leave for a healthy benefit enrollment.
TemporaryLeaveModelBroker ¶
Bases: BaseModelBroker
cancel_temporary_leaves
classmethod
¶
Cancels a list of temporary leaves.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temporary_leave_ids
|
list[TemporaryLeaveId]
|
The temporary leave ids. |
required |
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/temporary_leave.py
create_temporary_leave
classmethod
¶
Create a temporary leave for a given enrollment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enrollment_id
|
EnrollmentId
|
The enrollment id. |
required |
start_date
|
date
|
The start date of the temporary leave. |
required |
end_date
|
date | None
|
The end date of the temporary leave. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
TemporaryLeave |
TemporaryLeave
|
The created temporary leave. |
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/temporary_leave.py
get_temporary_leaves
classmethod
¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/temporary_leave.py
get_temporary_leaves_for_enrollments
classmethod
¶
Get the temporary leaves for a list of enrollments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enrollment_ids
|
list[EnrollmentId]
|
The enrollment ids. |
required |
with_cancelled
|
bool
|
Whether to include cancelled temporary leaves. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
list[TemporaryLeave]
|
list[TemporaryLeave]: The temporary leaves for the given enrollments. |
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/temporary_leave.py
update_temporary_leaves
classmethod
¶
Updates the start date and/or end date of a list of temporary leaves. As end_date can be None, we need to use a sentinel value to differentiate between None and not_set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temporary_leave_ids
|
list[TemporaryLeaveId]
|
The temporary leave ids. |
required |
start_date
|
date | None
|
The start date of the temporary leave. |
None
|
end_date
|
date | None
|
The end date of the temporary leave. |
NOT_SET
|
Source code in components/healthy_benefits/subcomponents/affiliation/internal/models/brokers/temporary_leave.py
TemporaryLeaveStatus ¶
Bases: AlanBaseEnum
Represents the status of a temporary leave.
bulk_cancel_enrollments ¶
Cancel provided list of enrollments Ignores enrollments that do not exist
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
bulk_enroll ¶
Enroll list of profiles to a given subscription. Will raise an error if the given subscription is not actively subscribed to this benefit at this date
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
bulk_terminate_enrollments ¶
End a bulk of enrollments at the given end date (default to today if not set)
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
cancel_enrollment ¶
Cancel provided enrollment. Raise an error if the enrollment does not exist
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_active_or_future_enrollments ¶
Retrieve active enrollments at a given date, or the next future enrollments if none are active.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
at_date
|
date
|
The reference date to check for active enrollments. |
required |
subscription_id
|
SubscriptionId
|
The subscription to filter enrollments by. |
required |
profile_ref
|
Optional[str]
|
Unique reference identifier of the user profile. If None, enrollments are fetched without filtering by profile. |
None
|
Returns:
| Type | Description |
|---|---|
list[Enrollment]
|
list[Enrollment]: A list of active enrollments at the given date, or the |
list[Enrollment]
|
next available future enrollments if none are active. |
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
get_active_or_future_or_last_ended_benefit_enrollment ¶
get_active_or_future_or_last_ended_benefit_enrollment(
profile_ref, benefit_type, at_date, subscription_id=None
)
Retrieve the most suitable enrollment based on a user's profile reference, benefit type, and a specific date, with an optional subscription ID filter. This method prioritizes active, then future, and finally the most recent ended enrollment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile_ref
|
str
|
The profile reference to filter enrollments. |
required |
benefit_type
|
BenefitType
|
The type of benefit to filter enrollments. |
required |
at_date
|
date
|
The date used to determine the relevant active or ended enrollment status. |
required |
subscription_id
|
SubscriptionId | None
|
Optional; The subscription ID to further filter the enrollments. |
None
|
Returns:
| Type | Description |
|---|---|
Enrollment | None
|
Enrollment | None: The most relevant Enrollment object if found; otherwise, None. |
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_active_or_last_ended_user_enrollment ¶
get_active_or_last_ended_user_enrollment(
profile_ref, benefit_type, at_date, subscription_id=None
)
Get the active or last ended enrollment for a given user profile and benefit type at a given date. Optionally filter by subscription_id.
Returns None if no active or ended enrollment is found.
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_ended_enrollments ¶
get_ended_enrollments(
at_date=None,
benefit_types=None,
profile_refs=None,
subscription_ids=None,
)
Retrieves a list of ended enrollments based on provided filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
at_date
|
date | None
|
Optional date to filter enrollments that ended before this date. |
None
|
benefit_types
|
list[BenefitType] | None
|
Optional list of benefit types to filter enrollments by. |
None
|
profile_refs
|
list[str] | None
|
Optional list of profile reference IDs to filter enrollments by. |
None
|
subscription_ids
|
list[SubscriptionId] | None
|
Optional list of subscription IDs to filter enrollments by. |
None
|
Returns:
| Type | Description |
|---|---|
list[Enrollment]
|
List of Enrollment dataclass instances representing ended enrollments. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no filter parameters (profile_refs, benefit_types, subscription_ids) are provided. |
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_enrollment ¶
get_enrollment_by_transfer_history_id ¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_enrollments_active_in_period ¶
get_enrollments_active_in_period(
period,
benefit_types=None,
profile_refs=None,
subscription_ids=None,
)
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_enrollments_active_on ¶
get_enrollments_active_on(
active_on,
profile_refs=None,
benefit_types=None,
subscription_ids=None,
)
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_enrollments_by_ids ¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_enrollments_on_subscription ¶
get_enrollments_on_subscription(
subscription_ref,
active_on=None,
ended_on=None,
active_on_or_after=None,
profile_ref=None,
)
Retrieves a list of enrollments for a given subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ref
|
str
|
The reference ID of the subscription to fetch enrollments for |
required |
active_on
|
datetime | None
|
If provided, only returns enrollments that are active on this date |
None
|
profile_ref
|
str | None
|
If provided, filters enrollments to only those matching this profile reference |
None
|
active_on_or_after
|
date | None
|
If provided, only returns enrollments that are active on or after this date |
None
|
ended_on
|
date | None
|
If provided, only returns enrollments that ended on this date |
None
|
Returns:
| Type | Description |
|---|---|
list[Enrollment]
|
list[Enrollment]: List of Enrollment dataclass objects representing the matching enrollments |
The function queries the enrollment database and converts the results to dataclass objects. Enrollments can be filtered by: - Active status on a specific date - Profile reference - Subscription reference (required)
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
get_enrollments_starting_after ¶
get_enrollments_starting_after(
active_after,
profile_refs=None,
benefit_types=None,
subscription_ids=None,
)
Get all enrollments that starts AFTER the provided date Warning: This method does not return enrollments that start before the provided date even if active on it
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
get_profile_enrollments_active_on ¶
Return all active Enrollments at date, for profile and subscription
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
get_subscription_active_enrollments_on ¶
Retrieves a list of active enrollments for a given subscription on a specific date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
at_date
|
date
|
The date for which to check active enrollments. |
required |
subscription_id
|
SubscriptionId
|
The reference ID of the subscription. |
required |
Returns:
| Type | Description |
|---|---|
list[Enrollment]
|
A list of Enrollment objects that are active on the specified date for the given subscription. |
list[Enrollment]
|
Returns an empty list if there is no active subscription on that date. |
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
is_profile_enrolled ¶
Determine whether a user profile is enrolled in a given subscription at a specific date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
at_date
|
datetime
|
The date at which enrollment status should be checked. |
required |
profile_ref
|
str
|
Unique reference identifier of the user profile. |
required |
subscription_id
|
SubscriptionId
|
The subscription to check enrollment for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the profile is enrolled at the given date, False otherwise. |
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
terminate_enrollment ¶
End an enrollment at the given end date (default to today if not set)
Source code in components/healthy_benefits/subcomponents/affiliation/protected/enrollment.py
update_enrollment ¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
update_enrollment_transfer_history_id ¶
Source code in components/healthy_benefits/subcomponents/affiliation/internal/business_logic/enrollment.py
components.healthy_benefits.public.commands ¶
components.healthy_benefits.public.entities ¶
components.healthy_benefits.public.pricing ¶
SubscriptionDiscount
dataclass
¶
create_subscription_discount ¶
Create a discount for a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
SubscriptionId
|
The subscription id. |
required |
start_month
|
Month
|
The start month of the discount. |
required |
end_month
|
Month
|
The end month of the discount. |
required |
price
|
int
|
The price of the discount. |
required |
reason
|
str
|
The reason for the discount. |
required |
Source code in components/healthy_benefits/subcomponents/pricing/protected/discount.py
get_baseline_subscription_price ¶
Get the baseline subscription price on a given date, excluding discounts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
SubscriptionId
|
The subscription id. |
required |
on_date
|
date
|
The date for which to get the subscription price. |
required |
Source code in components/healthy_benefits/subcomponents/pricing/protected/discount.py
get_current_subscription_discount ¶
Get the discount for a subscription on a given date.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
SubscriptionId
|
The subscription id. |
required |
on_date
|
date
|
The date for which to get the discount. |
required |
Source code in components/healthy_benefits/subcomponents/pricing/protected/discount.py
get_current_subscription_price ¶
Get the current subscription price on a given date.
This will take into account any ongoing discounts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
SubscriptionId
|
The subscription id. |
required |
on_date
|
date
|
The date for which to get the subscription price. |
required |
Source code in components/healthy_benefits/subcomponents/pricing/protected/discount.py
get_subscription_discounts ¶
Get all discounts for a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
SubscriptionId
|
The subscription id. |
required |
Returns:
| Type | Description |
|---|---|
list[SubscriptionDiscount]
|
List of all discounts for the subscription, ordered by start_month descending. |
Source code in components/healthy_benefits/subcomponents/pricing/protected/discount.py
update_discount_end_date ¶
Update the end date of a discount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
SubscriptionId
|
The subscription id (for validation). |
required |
discount_id
|
DiscountId
|
The discount id to update. |
required |
new_end_month
|
Month
|
The new end month for the discount. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the discount doesn't belong to the subscription or if the new end date is invalid. |
Source code in components/healthy_benefits/subcomponents/pricing/protected/discount.py
components.healthy_benefits.public.subscription ¶
Benefit
dataclass
¶
BenefitArgs
dataclass
¶
HealthyBenefitsSignedDocument
dataclass
¶
HealthyBenefitsSignedDocument(
id,
signed_bundle_id,
type,
uploader_id,
subscription_id,
signed_at,
)
Metadata for a signed document in Healthy Benefits.
HealthyBenefitsSignedDocumentType ¶
Bases: AlanBaseEnum
Types of signed documents linked to a Healthy Benefits subscription.
HealthyBenefitsSubscription
module-attribute
¶
Population
dataclass
¶
SubscriptionConfigurationArgs
dataclass
¶
SubscriptionVersion
dataclass
¶
Bases: WithValidityPeriod
A version of a subscription with a validity period and payload.
do_overlap ¶
Return True if both versions belong have the same id and overlap.
Source code in components/healthy_benefits/subcomponents/subscription/protected/entities.py
create_benefit ¶
Create a benefit for a given subscription payload and population.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload_id
|
SubscriptionPayloadId
|
Target subscription payload identifier. |
required |
population_id
|
PopulationId
|
Population that will receive the benefit. |
required |
type_ref
|
str
|
Benefit type reference (string key). |
required |
allowance
|
int
|
Allowance amount (in cents). |
required |
commit
|
bool
|
Whether to commit the change immediately. |
True
|
Returns:
| Type | Description |
|---|---|
Benefit
|
The created Benefit entity. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/benefit.py
create_population ¶
Create a new population for a given entity_ref.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_ref
|
str
|
Reference identifier of the entity the population belongs to. |
required |
name
|
str
|
The display name of the population. |
required |
commit
|
bool
|
Whether to persist changes immediately. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Population |
Population
|
The newly created population instance. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/population.py
create_subscription_payload ¶
Source code in components/healthy_benefits/subcomponents/subscription/protected/payload.py
end_company_subscription ¶
Ends a healthy benefits subscription
Source code in components/healthy_benefits/subcomponents/subscription/internal/business_logic/subscription.py
get_company_subscriptions_in_period ¶
Source code in components/healthy_benefits/subcomponents/subscription/internal/business_logic/subscription.py
get_ongoing_or_future_or_last_subscription_or_none ¶
Return ongoing/future subscription at date, else the most recent past, or None.
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_ongoing_or_future_subscription ¶
Return the ongoing or future subscription for a company at a date.
Raises:
| Type | Description |
|---|---|
BaseErrorCode
|
If none exists. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_ongoing_or_future_subscription_or_none ¶
Return ongoing/future subscription for a company, or None if absent.
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_or_download_document ¶
Downloads a document if the requester is the owner of the subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
document_id
|
UUID
|
The ID of the document to download. |
required |
download_for_owner_ref
|
str
|
The owner_ref of the user requesting the download. |
required |
Raises:
| Type | Description |
|---|---|
missing_resource
|
If the document does not exist. |
integrity_error
|
If the subscription attached to the document is not found. |
unauthorized
|
If the requester is not the owner of the subscription. |
Returns:
| Type | Description |
|---|---|
tuple[str, IO[bytes]]
|
tuple[str, IO[bytes]]: A tuple with the file name and the file content. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/signed_documents.py
get_population ¶
Retrieve a single population by its unique identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
population_id
|
PopulationId
|
The unique identifier of the population to fetch. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Population |
Population
|
The population instance corresponding to the provided ID. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/population.py
get_populations ¶
Retrieve all populations associated with a specific entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_ref
|
str
|
Reference identifier of the entity whose populations should be fetched. |
required |
Returns:
| Type | Description |
|---|---|
list[Population]
|
list[Population]: A list of populations associated with the entity. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/population.py
get_signed_documents_for_subscription ¶
Retrieves all signed documents for a given subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_id
|
UUID
|
The ID of the subscription. |
required |
Returns:
| Type | Description |
|---|---|
list[HealthyBenefitsSignedDocument]
|
list[HealthyBenefitsSignedDocument]: A list of signed documents. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/signed_documents.py
get_subscription ¶
Return the subscription active for a company at a date.
Raises:
| Type | Description |
|---|---|
BaseErrorCode
|
If none exists. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_subscription_benefit ¶
Return a specific benefit (by type and population) at a date, or None.
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_subscription_benefits ¶
Return all benefits for a population at a date.
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_subscription_by_id ¶
Fetch a subscription (any type) by its identifier.
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
get_subscriptions ¶
Retrieves all healthy benefits subscriptions filtered by an optional time period.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period
|
ValidityPeriod | None
|
Optional time period to filter subscriptions. When None, returns all subscriptions regardless of their validity period. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, HealthyBenefitsSubscription]
|
dict[str, HealthyBenefitsSubscription]: Dictionary mapping owner reference to their corresponding healthy benefits subscription. Only returns owners that have at least one subscription. |
Note
- Uses the external subscription service to fetch raw subscription data
- Filters for healthy benefits scope specifically
- For owners with multiple subscriptions, only returns the first subscription
- Owners without any subscriptions are excluded from the result
Source code in components/healthy_benefits/subcomponents/subscription/internal/business_logic/subscription.py
get_subscriptions_for ¶
Get all subscriptions to healthy benefits for a given company. :param company_ref: The company reference :param period: if set, only subscriptions overlapping this period are returned :return: list[HealthyBenefitsSubscription]
Source code in components/healthy_benefits/subcomponents/subscription/internal/business_logic/subscription.py
subscribe ¶
Create a subscription for a company.
Source code in components/healthy_benefits/subcomponents/subscription/protected/subscription.py
update_subscription ¶
Source code in components/healthy_benefits/subcomponents/subscription/internal/business_logic/subscription.py
upload_signed_contract ¶
Uploads a signed contract and adds general conditions for a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription
|
Subscription[SubscriptionVersion]
|
The subscription to upload the contract for. |
required |
document
|
BytesIO
|
The signed contract file. |
required |
uploader_id
|
UUID
|
The ID of the user uploading the document. |
required |
document_type
|
HealthyBenefitsSignedDocumentType
|
The type of the document. |
required |
signer
|
Signer
|
The signer of the document. |
required |
commit
|
bool
|
Whether to commit the session. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
HealthyBenefitsSignedDocument |
HealthyBenefitsSignedDocument
|
The uploaded signed document. |
Source code in components/healthy_benefits/subcomponents/subscription/protected/signed_documents.py
upload_signed_document ¶
Uploads a signed document for a subscription.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription
|
Subscription[SubscriptionVersion]
|
The subscription to upload the document for. |
required |
document
|
BytesIO
|
The signed document file. |
required |
uploader_id
|
UUID
|
The ID of the user uploading the document. |
required |
document_type
|
HealthyBenefitsSignedDocumentType
|
The type of the document. |
required |
signer
|
Signer
|
The signer of the document. |
required |
commit
|
bool
|
Whether to commit the session. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
HealthyBenefitsSignedDocument |
HealthyBenefitsSignedDocument
|
The uploaded signed document. |