Skip to content

Instantly share code, notes, and snippets.

@melissajhansen
Created March 25, 2020 22:08
Show Gist options
  • Save melissajhansen/bde0ee9274b923844da37c474cf2dd9c to your computer and use it in GitHub Desktop.
Save melissajhansen/bde0ee9274b923844da37c474cf2dd9c to your computer and use it in GitHub Desktop.
Template for starting RecipeHelper
/* A helper class for our Recipe Management App. This class contains static methods
that provide fuctionality related to recipes
*/
public with sharing class RecipeHelper {
// takes ingredient details and creates a corresponding SOBject record with the provided recipe ID as the parent
public static void addIngredient (String ingredientName, Integer measurementAmount, String measurementType, ID recipeId) {
}
public static List < String > generateGroceryList(ID recipeId) {
//Based on the recipe and its' ingredients, generate a shopping list for all items
//return a list of the names of all the ingredients
}
public void scaleRecipeForServings (ID recipeId, Integer desiredServings) {
// based on the desired servings, scale the recipe ingredients up or down.
// use system.debug to print out the new ingredient quantity
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment