X-Git-Url: http://git.euphorik.ch/?p=recipes.git;a=blobdiff_plain;f=backend%2Fsrc%2Fmodel.rs;fp=backend%2Fsrc%2Fmodel.rs;h=d012bc9b99ce8233ab61de0b6919e89f38459433;hp=ced209d0be14933d4c79ed6c023a8ec53e7d1a93;hb=108476e3554ea3a25dca5b5ab260f38c1e734221;hpb=a080d19cb9076780db9e86325b2ab617886e2a5f diff --git a/backend/src/model.rs b/backend/src/model.rs index ced209d..d012bc9 100644 --- a/backend/src/model.rs +++ b/backend/src/model.rs @@ -1,10 +1,14 @@ struct Recipe { - ingredients: Vec, - process: Vec, + title: String, + estimate_time: Option, // [min]. + difficulty: Option, + + //ingredients: Vec, // For four people. + process: Vec, } struct Ingredient { - quantity: Quantity, + quantity: Option, name: String, } @@ -12,15 +16,16 @@ struct Quantity { value: f32, unit: String, } + struct Group { - name: String, + name: Option, steps: Vec, } struct Step { - action: String, - input: Vec, - output: Vec, + action: String, + input: Vec, + output: Vec, } struct IntermediateSubstance { @@ -30,5 +35,12 @@ struct IntermediateSubstance { enum StepInput { Ingredient(Ingredient), - IntermediateSubstance, -} \ No newline at end of file + IntermediateSubstance(IntermediateSubstance), +} + +enum Difficulty { + Unknown, + Easy, + Medium, + Hard, +}