Skip to content

Add rawWorkoutActivityType to WorkoutHealthValue #1222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klnfreedom
Copy link

This PR introduces a new field, rawWorkoutActivityType, to the WorkoutHealthValue model. The primary motivation for this addition is to retain the original workout activity type string from the native health data provider (e.g., Apple Health or Google Fit).

Currently, workoutActivityType relies on a predefined HealthWorkoutActivityType enum, which does not cover all possible activity types provided by health platforms. As a result, any unsupported type defaults to HealthWorkoutActivityType.OTHER, leading to loss of information and granularity.

By storing the raw string in rawWorkoutActivityType, we can:

Preserve the exact source activity type for downstream processing or analytics.

Enable future extensions or mappings without data loss.

Improve compatibility with custom or newer activity types not yet reflected in the enum.

This change is backward-compatible and does not affect existing functionality that relies on the enum, while making the system more extensible and robust for real-world data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant