Beginning of the model

This commit is contained in:
Grégory Burri 2019-08-15 15:52:49 +02:00
parent a372187c8d
commit 89f0943c08

34
backend/src/model.rs Normal file
View 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,
}