Beginning of the model
authorGrégory Burri <gregory.burri@matisa.ch>
Thu, 15 Aug 2019 13:52:49 +0000 (15:52 +0200)
committerGrégory Burri <gregory.burri@matisa.ch>
Thu, 15 Aug 2019 13:52:49 +0000 (15:52 +0200)
backend/src/model.rs [new file with mode: 0644]

diff --git a/backend/src/model.rs b/backend/src/model.rs
new file mode 100644 (file)
index 0000000..ced209d
--- /dev/null
@@ -0,0 +1,34 @@
+struct Recipe {\r
+   ingredients: Vec<Ingredient>,\r
+   process: Vec<Group>,\r
+}\r
+\r
+struct Ingredient {\r
+    quantity: Quantity,\r
+    name: String,\r
+}\r
+\r
+struct Quantity {\r
+    value: f32,\r
+    unit: String,\r
+}\r
+struct Group {\r
+    name: String,\r
+    steps: Vec<Step>,\r
+}\r
+\r
+struct Step {\r
+   action: String,\r
+   input: Vec<StepInput>,\r
+   output: Vec<IntermediateSubstance>,\r
+}\r
+\r
+struct IntermediateSubstance {\r
+    name: String,\r
+    quantity: Option<Quantity>,\r
+}\r
+\r
+enum StepInput {\r
+    Ingredient(Ingredient),\r
+    IntermediateSubstance,\r
+}
\ No newline at end of file