aboutsummaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
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}