projects
/
recipes.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial model + some various changes
[recipes.git]
/
backend
/
src
/
model.rs
diff --git
a/backend/src/model.rs
b/backend/src/model.rs
index
ced209d
..
d012bc9
100644
(file)
--- a/
backend/src/model.rs
+++ b/
backend/src/model.rs
@@
-1,10
+1,14
@@
struct Recipe {
\r
struct Recipe {
\r
- ingredients: Vec<Ingredient>,
\r
- process: Vec<Group>,
\r
+ title: String,
\r
+ estimate_time: Option<i32>, // [min].
\r
+ difficulty: Option<Difficulty>,
\r
+
\r
+ //ingredients: Vec<Ingredient>, // For four people.
\r
+ process: Vec<Group>,
\r
}
\r
\r
struct Ingredient {
\r
}
\r
\r
struct Ingredient {
\r
- quantity:
Quantity
,
\r
+ quantity:
Option<Quantity>
,
\r
name: String,
\r
}
\r
\r
name: String,
\r
}
\r
\r
@@
-12,15
+16,16
@@
struct Quantity {
value: f32,
\r
unit: String,
\r
}
\r
value: f32,
\r
unit: String,
\r
}
\r
+
\r
struct Group {
\r
struct Group {
\r
- name:
String
,
\r
+ name:
Option<String>
,
\r
steps: Vec<Step>,
\r
}
\r
\r
struct Step {
\r
steps: Vec<Step>,
\r
}
\r
\r
struct Step {
\r
- action: String,
\r
- input: Vec<StepInput>,
\r
- output: Vec<IntermediateSubstance>,
\r
+
action: String,
\r
+
input: Vec<StepInput>,
\r
+
output: Vec<IntermediateSubstance>,
\r
}
\r
\r
struct IntermediateSubstance {
\r
}
\r
\r
struct IntermediateSubstance {
\r
@@
-30,5
+35,12
@@
struct IntermediateSubstance {
\r
enum StepInput {
\r
Ingredient(Ingredient),
\r
\r
enum StepInput {
\r
Ingredient(Ingredient),
\r
- IntermediateSubstance,
\r
-}
\ No newline at end of file
+ IntermediateSubstance(IntermediateSubstance),
\r
+}
\r
+
\r
+enum Difficulty {
\r
+ Unknown,
\r
+ Easy,
\r
+ Medium,
\r
+ Hard,
\r
+}
\r