Skip to content

Commit

Permalink
Merge pull request #2 from Miltt/fixes
Browse files Browse the repository at this point in the history
changes in the FitbitFoodLog dto model
  • Loading branch information
Miltt authored Apr 30, 2024
2 parents 99dc765 + 24074a0 commit 360deb1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ namespace Sync.WebModels
public class FitbitFoodLogSummary
{
[JsonPropertyName("calories")]
public int Calories { get; set; }
public double? Calories { get; set; }
[JsonPropertyName("carbs")]
public double Carbs { get; set; }
public double? Carbs { get; set; }
[JsonPropertyName("fat")]
public double Fat { get; set; }
public double? Fat { get; set; }
[JsonPropertyName("fiber")]
public double Fiber { get; set; }
public double? Fiber { get; set; }
[JsonPropertyName("protein")]
public double Protein { get; set; }
public double? Protein { get; set; }
[JsonPropertyName("sodium")]
public double Sodium { get; set; }
public double? Sodium { get; set; }
[JsonPropertyName("water")]
public int Water { get; set; }
public double? Water { get; set; }

public FitbitFoodLogSummary()
{
Expand Down
2 changes: 1 addition & 1 deletion console/IntervalsUpdaters/IntervalsModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void BuildCalories(IntervalsWellness? intervalWellness, FitbitDataCollect
if (intervalWellness is null)
throw new ArgumentNullException(nameof(intervalWellness));

intervalWellness.KcalConsumed = wellnessData.FoodLog?.Summary?.Calories;
intervalWellness.KcalConsumed = (int?)wellnessData.FoodLog?.Summary?.Calories;
}

private bool TryCalcSleepScore(int totalTimeInBed, int totalMinutesAsleep, out double? score)
Expand Down

0 comments on commit 360deb1

Please sign in to comment.