Refactor Workout Logging and Streak Tracking#226
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
In this PR, I implement a comprehensive refactor of workout tracking and streak logic, including:
totalGymDaysandstreakStartfields to the GraphQL User typelogWorkoutmutation to consider specific workout facilitiesChanges Made
Change 1: Workout Logging Modification
Change 2: GraphQL
UserType ModificationtotalGymDaysfield, which represents the total number of distinct days that a user has logged a workoutgoalHistoryfield to be defined as a list of GraphQL Workout objects instead of days of the weekworkoutGoalfield to be defined as integersstreakStartfield, which represents the day that the most recent streak has began, if the user is currently in a streakChange 3: Streak Logic Refactor
activeStreakandmaxStreakfields on theUsertype while respecting shifts in workout goalsChange 4: Refactor Workout Goal History Tracking
Test Coverage
What I Tested
Streak and Workout Goals
Datescalar in order to avoid timezone drift, which would result in discrepancies between the actual logged date and the returned dateGoal Update Constraints
Workout Logging Correctness
Timezone/UTC Consistency
How I Tested