canteenlib/jsonb/
dish_ingredient.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::enums::unit_type::UnitType;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct DishIngredient {
    pub id : Uuid,
    pub ingredient_id : Uuid,
    pub amount : f32,
    pub unit : UnitType,
    pub allergies : Option<Vec<Uuid>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub comment : Option<String>,
    pub optional : bool,
    pub price_extra : Option<f32>,
    pub is_default : bool,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub group : Option<String>,
}