aboutsummaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-11-16 15:32:44 +0000
committerAkshay <[email protected]>2020-11-16 15:32:44 +0000
commit199f6bfd503901121b0cdf532a46de89b592ada0 (patch)
tree39f7f5ee38359fec26df641e40863153ba6aa346 /src/models.rs
parentaf628595f3cc5c373502fc73acf579047aee5482 (diff)
add product deets and update endpoints
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/models.rs b/src/models.rs
index fb6122c..6af1af6 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -1,6 +1,5 @@
1use super::schema::{members, product}; 1use super::schema::{members, product};
2 2
3use bigdecimal::BigDecimal;
4use diesel::{Insertable, Queryable}; 3use diesel::{Insertable, Queryable};
5use serde::{Deserialize, Serialize}; 4use serde::{Deserialize, Serialize};
6 5
@@ -35,7 +34,11 @@ pub struct Product {
35#[table_name = "product"] 34#[table_name = "product"]
36pub struct NewProduct { 35pub struct NewProduct {
37 pub name: String, 36 pub name: String,
37
38 #[serde(skip_serializing_if = "Option::is_none")]
38 pub kind: Option<String>, 39 pub kind: Option<String>,
39 pub price: f32, 40 pub price: f32,
41
42 #[serde(skip_serializing_if = "Option::is_none")]
40 pub description: Option<String>, 43 pub description: Option<String>,
41} 44}