Skip to content
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

Updates to facilitate production usage of webhooks and workout data from Concept2 #9

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

MoralCode
Copy link
Contributor

@MoralCode MoralCode commented Jul 14, 2024

This PR facilitates production use of Webhooks to automatically synchronize data from Concept2 and supersedes #8, which I didn't have the ability to edit.

This commit contains several key contributions, largely from @pfredCL:

  1. Introduce some new types to allow for parsing of more detailed workout data (C2HeartRate, C2Intervals, C2Splits, C2Workout)
  2. Update C2Results to handle additional data on intervals, heart rate, workout results, and rest data available from other result related endpoints in the Concept2 API.
  3. Refactored and simplified file structure to combine all the auto-generated components of the typings into one file (types/index.dart)
  4. Temporarily commit the generated freezed types to the repo for local (i.e. as a path or git dependency) usage of the library (long term im not a fan of this and would like to transition away from this eventually, see Remove files generated by freezed package once c2logbook is published #5)
  5. Temporarily introduce some new (deprecated) data models (C2FullResults and C2DetailedResult) for backwards compatibility with existing usecases.
  6. Improve unit testing with more tests, as well as more realistic data samples taken from the Concept2 Docs

Deprecated functionality Migration Guide

In order to be safe from the removal of the deprecated features in this PR:

  1. Replace uses of C2FullResults with C2Results, which has been updated to support the additional fields that were introduced in C2FullResults
  2. Replace uses of the C2FullResults.date field with C2Results.endDate
  3. Remove uses of C2DetailedResult. Instead, either use methods on C2Logbook to fetch data or manually extract the JSON data from the data key of the JSON response from the Concept2 API and feed it into C2Results.fromJson() or another supported type

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.

2 participants