-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathIRecipeManagement.cs
58 lines (49 loc) · 1.73 KB
/
IRecipeManagement.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) 2023, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0
using System;
using System.Collections.Generic;
using Moryx.AbstractionLayer.Products;
using Moryx.AbstractionLayer.Recipes;
namespace Moryx.Products.Management
{
/// <summary>
/// Component to handle all recipe operations
/// </summary>
internal interface IRecipeManagement
{
/// <summary>
/// Loads the recipe by the given identifier
/// </summary>
IProductRecipe Get(long recipeId);
/// <summary>
/// Will load all recipes by the given product
/// </summary>
IReadOnlyList<IProductRecipe> GetAllByProduct(IProductType productType);
/// <summary>
/// Retrieves a recipe for the product
/// </summary>
IReadOnlyList<IProductRecipe> GetRecipes(IProductType productType, RecipeClassification classifications);
/// <summary>
/// A recipe was changed, give users the chance to update their reference
/// </summary>
event EventHandler<IRecipe> RecipeChanged;
/// <summary>
/// Save recipe to DB
/// </summary>
long Save(IProductRecipe instance);
/// <summary>
/// Saves multiple recipes
/// </summary>
void Save(long productId, ICollection<IProductRecipe> recipes);
/// <summary>
/// Remove the recipe by the given identifier
/// </summary>
void Remove(long recipeId);
/// <summary>
/// Create instance of a recipe
/// </summary>
/// <param name="recipeType">Full name of the recipe type</param>
/// <returns></returns>
IProductRecipe CreateRecipe(string recipeType);
}
}