SPIKE: Flip TraxRecord/Activity relationship #180
Labels
No Label
hex-grid
maintenance
music-player
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: savanni/monorepo#180
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the TraxRecord/Activity relationship looks like this:
When I want to update a bike ride, I've written a function like this:
I'm having to write a lot of obtuse code to deal with the wrapping and unwrapping of data when I know for sure that I want to be working with TimeDistanceRecord data.
I know that I wrote this structure with the idea that filtering to particular activity types should be easier than it was with the legacy data structure, but that seems to have come at the cost of making it very difficult to manipulate the records in a type-safe way.
In a spike, I invert all of the code back to the legacy format, so that the structure of the activity is primary, and the actual activity is an attribute:
Compare the resulting data manipulation code to the current code to determine which is easier to work with.
I finished this in #182 - Invert the TraxRecord - monorepo - gitea: Gitea Service. It did not immediately give the benefits I was hoping for, but I got the hoped-for benefits as I was finished #169 - Render and be able to edit bike rides (and sorta other time distance workouts) - monorepo - gitea: Gitea Service.