-
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.
- Loading branch information
Showing
26 changed files
with
725 additions
and
625 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
pub mod answer; | ||
pub mod comment; | ||
pub mod message; | ||
pub mod models; | ||
pub mod question; |
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 @@ | ||
pub mod models; |
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,37 @@ | ||
use chrono::{DateTime, Utc}; | ||
#[cfg(test)] | ||
use proptest_derive::Arbitrary; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::{ | ||
form::{models::FormId, question::models::QuestionId}, | ||
user::models::User, | ||
}; | ||
|
||
pub type AnswerId = types::IntegerId<FormAnswer>; | ||
|
||
#[derive(Serialize, Deserialize, PartialEq, Debug)] | ||
pub struct FormAnswer { | ||
pub id: AnswerId, | ||
pub user: User, | ||
pub timestamp: DateTime<Utc>, | ||
pub form_id: FormId, | ||
pub title: Option<String>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)] | ||
pub struct FormAnswerContent { | ||
pub answer_id: AnswerId, | ||
pub question_id: QuestionId, | ||
pub answer: String, | ||
} | ||
|
||
pub type AnswerLabelId = types::IntegerId<AnswerLabel>; | ||
|
||
#[cfg_attr(test, derive(Arbitrary))] | ||
#[derive(Serialize, Deserialize, Debug, PartialEq)] | ||
pub struct AnswerLabel { | ||
pub id: AnswerLabelId, | ||
pub answer_id: AnswerId, | ||
pub name: String, | ||
} |
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 @@ | ||
pub mod models; |
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,15 @@ | ||
use chrono::{DateTime, Utc}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use crate::{form::answer::models::AnswerId, user::models::User}; | ||
|
||
pub type CommentId = types::IntegerId<Comment>; | ||
|
||
#[derive(Serialize, Deserialize, Debug, PartialEq)] | ||
pub struct Comment { | ||
pub answer_id: AnswerId, | ||
pub comment_id: CommentId, | ||
pub content: String, | ||
pub timestamp: DateTime<Utc>, | ||
pub commented_by: User, | ||
} |
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 @@ | ||
pub mod models; |
Oops, something went wrong.