-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from smart--petea/issue_enum
Issue enum
- Loading branch information
Showing
6 changed files
with
77 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod rating; | ||
|
||
pub use rating::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use crate::models; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_valid::Validate; | ||
|
||
#[derive(Serialize, Deserialize, Debug, Validate)] | ||
pub struct Rating { | ||
pub obj_id: i32, // product external id | ||
pub category: models::RateCategory, // rating of product | rating of service etc | ||
#[validate(max_length = 1000)] | ||
pub comment: Option<String>, // always linked to a product | ||
#[validate(minimum = 0)] | ||
#[validate(maximum = 10)] | ||
pub rate: i32, // | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
pub mod routes; | ||
pub mod startup; | ||
pub mod configuration; | ||
pub mod telemetry; | ||
pub mod forms; | ||
mod middleware; | ||
mod models; | ||
pub mod models; | ||
pub mod routes; | ||
pub mod services; | ||
pub mod startup; | ||
pub mod telemetry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod rating; | ||
pub mod stack; | ||
pub mod user; | ||
pub mod stack; | ||
|
||
pub use rating::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters