diff options
Diffstat (limited to 'crates/rocie-client/src/models')
| -rw-r--r-- | crates/rocie-client/src/models/barcode.rs | 4 | ||||
| -rw-r--r-- | crates/rocie-client/src/models/mod.rs | 2 | ||||
| -rw-r--r-- | crates/rocie-client/src/models/product_amount.rs | 30 |
3 files changed, 34 insertions, 2 deletions
diff --git a/crates/rocie-client/src/models/barcode.rs b/crates/rocie-client/src/models/barcode.rs index 2b1759a..7690be2 100644 --- a/crates/rocie-client/src/models/barcode.rs +++ b/crates/rocie-client/src/models/barcode.rs @@ -16,11 +16,11 @@ pub struct Barcode { #[serde(rename = "amount")] pub amount: Box<models::UnitAmount>, #[serde(rename = "id")] - pub id: i64, + pub id: i32, } impl Barcode { - pub fn new(amount: models::UnitAmount, id: i64) -> Barcode { + pub fn new(amount: models::UnitAmount, id: i32) -> Barcode { Barcode { amount: Box::new(amount), id, diff --git a/crates/rocie-client/src/models/mod.rs b/crates/rocie-client/src/models/mod.rs index 42fecc5..20ed0ff 100644 --- a/crates/rocie-client/src/models/mod.rs +++ b/crates/rocie-client/src/models/mod.rs @@ -2,6 +2,8 @@ pub mod barcode; pub use self::barcode::Barcode; pub mod product; pub use self::product::Product; +pub mod product_amount; +pub use self::product_amount::ProductAmount; pub mod product_stub; pub use self::product_stub::ProductStub; pub mod unit; diff --git a/crates/rocie-client/src/models/product_amount.rs b/crates/rocie-client/src/models/product_amount.rs new file mode 100644 index 0000000..6f1b436 --- /dev/null +++ b/crates/rocie-client/src/models/product_amount.rs @@ -0,0 +1,30 @@ +/* + * rocie-server + * + * An enterprise grocery management system + * + * The version of the OpenAPI document: 0.1.0 + * Contact: benedikt.peetz@b-peetz.de + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct ProductAmount { + #[serde(rename = "amount")] + pub amount: Box<models::UnitAmount>, + #[serde(rename = "product_id")] + pub product_id: uuid::Uuid, +} + +impl ProductAmount { + pub fn new(amount: models::UnitAmount, product_id: uuid::Uuid) -> ProductAmount { + ProductAmount { + amount: Box::new(amount), + product_id, + } + } +} + |
