Readonly ingredientsThe set of ingredients that are available for use in the beverage graph.
Utility method to retrieve the ingredients that are associated with the specified type.
The type of the ingredient to retrieve.
The set of ingredients that are associated with the specified type.
The IngredientContainer represents the collection of IngredientModel entities that are considered as part of the KOS Beverage Graph.
Its primary purpose is expose the set of ingredients that can be used to compose a pourable beverage. The presence or absence of an ingredient in the container will determine if the ingredient is available for use in the beverage graph.
The ingredient container will index all of the underlying ingredients by the
typeproperty of the ingredient. This allows for the grouping and filtering of ingredients based on thetypeproperty. For example, to get the ingredients that are used for flavor shots, you would call IngredientContainer.getIngredientsByType with thetypeof the flavor shot.The Ingredient is a IKosDataModel and is registered with the model registry using the IngredientContainer type.
See
Lifecycle
Load
During the
loadphase of the model lifecycle, the set of IngredientModel models will be retrieved and processed. The nodes will be indexed based on the definedtypefor the node. Thetypeis defined as part of the backend Ingredient model.Extension Points
The
loadlifecycle hook will call into the ExtensionType.IngredientLoader extension point in order to establish the context that will be used to populate the ingredients nodes. Use of this extension point is optional.The
loadlifecycle hook will call into the ExtensionType.IngredientMapper for each ingredient node that is retrieved from the backend. The extension point will be called with the Ingredient context data and the IngredientServices.IngredientResponse for the ingredient node and will map the results into the IngredientModel as part of thedataproperty.The
loadlifecycle hook will call into the ExtensionType.IngredientTypeMapper for each ingredient node that is retrieved from the backend. The extension point will be called with the Ingredient context data and the IngredientServices.IngredientResponse for the ingredient node. The results will be mapped into the IngredientModel as thetypeproperty.