Api reference
components.health_programs.public.business_logic ¶
actions ¶
delete_health_program_data ¶
delete_all_health_program_data_for_user ¶
Delete all health program progress and override records for a user.
Returns the total number of deleted records.
Source code in components/health_programs/public/business_logic/actions/delete_health_program_data.py
health_program_override ¶
update_health_program_override_for_user ¶
update_health_program_override_for_user(
user,
program_slug,
overridden_segment_slug,
custom_program_id,
dedicated_time,
commit=True,
)
Update or create the health program override for a user given some parameters.
Source code in components/health_programs/public/business_logic/actions/health_program_override.py
health_program_progress ¶
mark_health_program_as_ready ¶
mark_health_program_as_ready(
user,
program_slug,
coach_name,
coach_picture_url,
has_booked_appointment,
commit=True,
)
Source code in components/health_programs/public/business_logic/actions/health_program_progress.py
queries ¶
health_program_override ¶
get_all_health_program_overrides ¶
Source code in components/health_programs/public/business_logic/queries/health_program_override.py
get_health_program_override ¶
Source code in components/health_programs/public/business_logic/queries/health_program_override.py
health_program_progress ¶
get_all_user_health_program_data ¶
Get all health program progresses for a user.
Source code in components/health_programs/public/business_logic/queries/health_program_progress.py
get_all_user_health_program_progresses ¶
Get all health program progresses for a user.
Source code in components/health_programs/public/business_logic/queries/health_program_progress.py
get_feature_users_with_health_program_interaction_after ¶
Return feature users whose most recent health program interaction is after cutoff.
Queries MAX(last_updated_at) across all HealthProgramProgress rows per feature user using batched tuple IN clauses to avoid overwhelming PostgreSQL with large OR chains.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_users
|
list[FeatureUser]
|
Feature users to check |
required |
cutoff
|
datetime
|
Only return users with interactions strictly after this date |
required |
Source code in components/health_programs/public/business_logic/queries/health_program_progress.py
get_health_program_progress ¶
Get the health program progress for a user and a program.
Source code in components/health_programs/public/business_logic/queries/health_program_progress.py
components.health_programs.public.controllers ¶
health_program ¶
HealthProgramController ¶
Bases: BaseController
PostHealthProgramProgressPostJsonArgs
dataclass
¶
PostHealthProgramProgressPostJsonArgs(
program_slug,
program_status,
tasks,
survey_source_type,
last_updated_at,
program_name=None,
program_id=None,
program_available_at=None,
preferred_notification_time_in_minutes=None,
current_day=None,
is_custom=None,
assigned_coach_medical_admin_id=None,
)
Arguments for posting health program progress.
PostHealthProgramProgressPostJsonSchema
module-attribute
¶
get_health_programs_override ¶
Source code in components/health_programs/public/controllers/health_program.py
get_health_programs_progress_for_sync ¶
Source code in components/health_programs/public/controllers/health_program.py
post_health_program_progress ¶
Source code in components/health_programs/public/controllers/health_program.py
components.health_programs.public.entities ¶
health_program_complete_data ¶
HealthProgramCompleteData
dataclass
¶
HealthProgramCompleteData(
program_slug,
program_name,
program_id,
custom_program_id,
overridden_segment_slug,
program_status,
preferred_notification_time_in_minutes,
tasks,
current_day,
survey_source_type,
last_updated_at,
assigned_coach_medical_admin_id,
dedicated_time,
)
Bases: DataClassJsonMixin
from_health_program_models
classmethod
¶
Source code in components/health_programs/public/entities/health_program_complete_data.py
health_program_override ¶
HealthProgramCustomTask
dataclass
¶
HealthProgramOverrideData
dataclass
¶
HealthProgramOverrideData(
program_slug,
segment_slug,
custom_program_id,
custom_tasks,
dedicated_time,
)
Bases: DataClassJsonMixin
from_health_program_override_model
classmethod
¶
Source code in components/health_programs/public/entities/health_program_override.py
health_program_progress ¶
HealthProgramProgressData
dataclass
¶
HealthProgramProgressData(
program_slug,
program_name,
program_status,
preferred_notification_time_in_minutes,
tasks,
current_day,
survey_source_type,
last_updated_at,
assigned_coach_medical_admin_id,
)
Bases: DataClassJsonMixin
from_health_program_progress_model
classmethod
¶
Source code in components/health_programs/public/entities/health_program_progress.py
HealthProgramTask
dataclass
¶
HealthProgramTask(
id,
status,
name,
day,
exercise_titles,
first_task_activity_date,
last_task_activity_date,
)
Bases: DataClassJsonMixin
components.health_programs.public.subscription ¶
subscribe_to_events ¶
All event subscriptions for health_programs.