Open ggneilc opened 9 months ago
from here it is fairly obvious which screen need what slices to work correctly:
from there it should be way straightforward development on implementing goal autocalculation from the frontend and adding that table in the backend, and then doing the same with healthscores !!
backend todo:
I don't think we will actually need anything from the backend at all from the data sync, I think the only thing we need from the backend's part is just being able to handle a list of entries.
in order to sync the data, we will just need to add a boolean flag to keep track of which entries have already been updated, and in app.js, add a useEffect that tries to sync the data from the store that is !synced.
The Redux Store
The redux store will need:
User
with basic user infoMeals
with a list of meal objectsWater
with a list of water objectsWeights
with a list of weight objectsSleep
with a list of sleep objectsGoals
with a list of string/intsScores
with a list of intsWe are then going to need
past
with these, so we can split up the reducers into the 4 pillars and have the user be slightly bigger:userSlice:
MealSlice: -userMeals -pastMeals
WeightSlice: -userWeight -pastWeight
WaterSlice: -userWater -pastWater
SleepSlice: -userSleep -pastSleep