Spaces:
Running
Running
Merge pull request #104 from Modarb-Ai-Trainer/stats
Browse files
src/modules/users/modules/home/responses/user-home-your-daily-intake.serialization.ts
CHANGED
|
@@ -15,6 +15,10 @@ export class UserHomeYourDailyIntakeSerialization {
|
|
| 15 |
@SwaggerResponseProperty('number')
|
| 16 |
caloriesBurned: number;
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
@Expose()
|
| 19 |
@SwaggerResponseProperty('number')
|
| 20 |
carbsGoal: number;
|
|
|
|
| 15 |
@SwaggerResponseProperty('number')
|
| 16 |
caloriesBurned: number;
|
| 17 |
|
| 18 |
+
@Expose()
|
| 19 |
+
@SwaggerResponseProperty('number')
|
| 20 |
+
caloriesIntake: number
|
| 21 |
+
|
| 22 |
@Expose()
|
| 23 |
@SwaggerResponseProperty('number')
|
| 24 |
carbsGoal: number;
|
src/modules/users/modules/home/services/user-home.service.ts
CHANGED
|
@@ -112,6 +112,7 @@ export class UserHomeService {
|
|
| 112 |
|
| 113 |
const caloriesBurned = todaysExercises.reduce((acc, curr) => acc + this.exercisesService.calculateCalories(curr), 0);
|
| 114 |
const caloriesLeft = caloriesGoal - caloriesBurned;
|
|
|
|
| 115 |
|
| 116 |
const carbsGoal = goalToCarbsMap[user.preferences?.fitness_goal] || 50;
|
| 117 |
const carbsConsumed = todaysMeals.reduce((acc, curr) => acc + curr.carbs, 0);
|
|
@@ -126,6 +127,7 @@ export class UserHomeService {
|
|
| 126 |
caloriesGoal,
|
| 127 |
caloriesLeft,
|
| 128 |
caloriesBurned,
|
|
|
|
| 129 |
carbsGoal,
|
| 130 |
carbsConsumed,
|
| 131 |
proteinGoal,
|
|
|
|
| 112 |
|
| 113 |
const caloriesBurned = todaysExercises.reduce((acc, curr) => acc + this.exercisesService.calculateCalories(curr), 0);
|
| 114 |
const caloriesLeft = caloriesGoal - caloriesBurned;
|
| 115 |
+
const caloriesIntake = todaysMeals.reduce((acc, curr) => acc + curr.calories, 0);
|
| 116 |
|
| 117 |
const carbsGoal = goalToCarbsMap[user.preferences?.fitness_goal] || 50;
|
| 118 |
const carbsConsumed = todaysMeals.reduce((acc, curr) => acc + curr.carbs, 0);
|
|
|
|
| 127 |
caloriesGoal,
|
| 128 |
caloriesLeft,
|
| 129 |
caloriesBurned,
|
| 130 |
+
caloriesIntake,
|
| 131 |
carbsGoal,
|
| 132 |
carbsConsumed,
|
| 133 |
proteinGoal,
|