Closed dcolli23 closed 4 years ago
We need to create a recipe class for storing all of the ingredients in a recipe and also tallying up nutrition information for that recipe.
The Recipe class should have the following members (this isn't necessarily an exhaustive list but includes the most important ones):
Recipe
ingredients
ingredient_amounts
measurement
serving
calories_per_serving
net_carbs_g_per_serving
protein_g_per_serving
fat_g_per_serving
date_of_creation
rating
instructions
I'm not certain if the storage of macros is the best approach. I'm thinking we store macros for quick access and we simply iterate through the ingredients map to tally up micronutrients. Might change this approach in the future, though.
I opted to not store the macros and instead have just a map for all nutrients.
Description
We need to create a recipe class for storing all of the ingredients in a recipe and also tallying up nutrition information for that recipe.
Proposal
The
Recipe
class should have the following members (this isn't necessarily an exhaustive list but includes the most important ones):ingredients
(map with the FDC ID as the key and the ingredient object pointer as the value)ingredient_amounts
(map with FDC ID as the key and ameasurement
struct or class as the value).measurement
struct or class.serving
(measurement
class or struct)calories_per_serving
(double)net_carbs_g_per_serving
(double)protein_g_per_serving
(double)fat_g_per_serving
(double)date_of_creation
(time_t)rating
(int)instructions
(string)I'm not certain if the storage of macros is the best approach. I'm thinking we store macros for quick access and we simply iterate through the
ingredients
map to tally up micronutrients. Might change this approach in the future, though.