Beginning of the model
This commit is contained in:
parent
a372187c8d
commit
89f0943c08
1 changed files with 34 additions and 0 deletions
34
backend/src/model.rs
Normal file
34
backend/src/model.rs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
struct Recipe {
|
||||
ingredients: Vec<Ingredient>,
|
||||
process: Vec<Group>,
|
||||
}
|
||||
|
||||
struct Ingredient {
|
||||
quantity: Quantity,
|
||||
name: String,
|
||||
}
|
||||
|
||||
struct Quantity {
|
||||
value: f32,
|
||||
unit: String,
|
||||
}
|
||||
struct Group {
|
||||
name: String,
|
||||
steps: Vec<Step>,
|
||||
}
|
||||
|
||||
struct Step {
|
||||
action: String,
|
||||
input: Vec<StepInput>,
|
||||
output: Vec<IntermediateSubstance>,
|
||||
}
|
||||
|
||||
struct IntermediateSubstance {
|
||||
name: String,
|
||||
quantity: Option<Quantity>,
|
||||
}
|
||||
|
||||
enum StepInput {
|
||||
Ingredient(Ingredient),
|
||||
IntermediateSubstance,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue